Using Phantom.js evaluate, how can I get the HTML of the page?

别说谁变了你拦得住时间么 提交于 2019-12-01 09:37:45

The type of document is an HTML document. To get the entire DOM as a string, you could do document.documentElement.outerHTML.

From outside evaluate, you can use page.content. It is a string.

I don't know what you mean by "HTML includes CSS and JavaScript" or "the web page's HTML". Are you referring to the difference between the page source and the DOM as modified by scripting? Both the above give you the current DOM, not the original page source.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!