(I am sorry that for the credential reason, I am not able to share the code)
I am trying to use PhantomJS to simulate a user visits a web page. The page is only loaded partially (only the navigation bar is loaded). It is also weird that the layout looks pretty weird than expected comparing the screenshot (page.render()) to the web page opened via browser manually. I initially thought it was because I need to wait for more time/the page hasn't finished loading; however, after extending the waiting time to 300 seconds it still didn't load. Also, even though the page doesn't look like loaded entirely, I am able to click the buttons on the navigation part. May I ask for any potential solutions?
Several things I have tried:
- Tried to utilize onRequestReceived(), on RequestRequested() and all other event listener.
- Tried to wait for a long time.
- Tried running script with
--ignore-ssl-errors=true --web-security=no
- 'status' is not failed.
- Currently I suspect maybe there are some JS files in that html are not imported correctly but not sure if this is the correct direction to investigate. Any suggestion on this maybe how to verify which js files were not imported? I tried to print all requested resources and noticed some are missing comparing to the Network list under Inspect Element tool of the browser.
One thing worth mention is that I tried to use Selenium to do the same thing and the page was loaded perfectly, so there's no issue with the url/html itself. (We prefer to still use PhantomJS due to some scenarios.)
Tech: PhantomJS 2.1.1
Thanks for any advice!
question from:
https://stackoverflow.com/questions/65931425/phantomjs-doesnt-load-the-entire-page-with-enough-time 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…