Phantomjs works but is very slow

后端 未结 3 663
無奈伤痛
無奈伤痛 2021-02-01 22:25

I am trying to take a screenshot of a webpage with PhantomJS. Specifically, I am using the example of capturing espn.com from this example. My code looks like this:

3条回答
  •  庸人自扰
    2021-02-01 23:14

    Yes this is normal. When you attempt to render, PhantonJS will still wait for the page.open event to fire the load event to signify that the entire DOM has been loaded.

    Take a look at what happens when I load espn.com locally on my system. It takes ~2 seconds for DOMContentLoaded to finish, and then ~7 seconds for the ready event to fire.

    enter image description here

提交回复
热议问题