如何使用无头 - 奇物php获得DOM
我使用的是无头chr-php,但是gethtml
函数似乎可以获得 html源代码。 https://github.com/chrome-php/chrome-php/chrome-php/chrome#get-get-get-get-get-get-get-get-get-get-get-get-get-get-get-get-get-get-get-get-get-get-get-相反
,我想在Chrome浏览器中显示 dom 。 所以,我该怎么做 我想在浏览器渲染后获取HTML源。
I'm using headless-chromium-php, but getHtml
function seems to get the html source code.
https://github.com/chrome-php/chrome#get-the-page-html
Instead, I want to get the DOM displayed in the chrome browser.
so, How can i do it
I want to get the html source after browser rendering.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您猜测时,您需要等待页面完成加载,包括任何JavaScript渲染;在该文档中查看早期的示例
https://github.com/chrome-php/chrome-php/chrome#评估页面上的记录获得内部HTML。
As you surmise, you need to wait for the page to finish loading, including any javascript rendering; have a look at the example earlier on in that documentation
https://github.com/chrome-php/chrome#evaluate-script-on-the-page to get the inner html.