如何使用无头 - 奇物php获得DOM

发布于 2025-01-30 05:11:51 字数 427 浏览 2 评论 0原文

我使用的是无头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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

演多会厌 2025-02-06 05:11:51

当您猜测时,您需要等待页面完成加载,包括任何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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文