Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splash doesn't render React single-page application #1182

Open
Azaze1l opened this issue Aug 18, 2023 · 2 comments
Open

Splash doesn't render React single-page application #1182

Azaze1l opened this issue Aug 18, 2023 · 2 comments

Comments

@Azaze1l
Copy link

Azaze1l commented Aug 18, 2023

Hey!

I'm trying to render this https://app.adapty.io/login page but facing some strange behavior. I'm getting a blank white page as a response:

Screenshot 2023-08-18 at 15 19 22

My lua function:

function main(splash, args)
  splash.private_mode_enabled = false
  splash:set_viewport_full()
  splash:set_user_agent('Mozilla/5.0 (Windows NT 6.1; rv:51.0) Gecko/20100101 Firefox/51.0')
  assert(splash:go(args.url))
  assert(splash:wait(60))
  return {
    html = splash:html(),
    png = splash:png(),
    har = splash:har(),
  }
end

After doing some research I've found some interesting related to my problem reports:
React website showing a blank white page and no content

Scrapy-splash not rendering dynamic content from a certain react-driven site

But there is still no context here.

Should I keep trying to use Splash as a rendering service or it can be a better option to use something different?
Does anyone have a guess why this happens with React apps?

@SardarDelha
Copy link

Splash cannot render single page applications.
In fact, Splash only receives the view source and does not understand the html that is created by JavaScript.
We used to use Splash before, but because it is no longer updated and also does not support SPA, we use playwright. Playwright is both simple and can be used in Python.

@Azaze1l
Copy link
Author

Azaze1l commented Sep 18, 2023

@SardarDelha thank you a lot for the alternative solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants