We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rod Version: v0.108.1
现在好多网页是用ajax获取数据再填充到网页中,想获取渲染后的代码,不是原始源代码 类似于chrome检查的功能中代码
在chromedp是这样实现的
if err := chromedp.Run(ctx, chromedp.Navigate(url), chromedp.Sleep(time.Duration(Interval)*time.Second), chromedp.OuterHTML("html", &pageHtml, chromedp.ByQuery), ); err != nil { log.Fatal(err) }
我尝试这样使用
page := browser.MustPage(startURL) utils.Sleep(10) html = page.MustElement("html").MustHTML()
但这里返回的原始html代码,不是渲染之后的
The text was updated successfully, but these errors were encountered:
同问
Sorry, something went wrong.
rod/page_test.go
Lines 138 to 140 in c78f6bd
单元测试可以看到 MustHTML 返回的就是渲染后的内容,只有点击了 button 后页面才可能出现 a="ok"
a="ok"
测试了,是没有问题了,我的代码中之前有使用browser.HijackRequests,有一些问题导致html是空白的
No branches or pull requests
Rod Version: v0.108.1
现在好多网页是用ajax获取数据再填充到网页中,想获取渲染后的代码,不是原始源代码
类似于chrome检查的功能中代码
在chromedp是这样实现的
我尝试这样使用
但这里返回的原始html代码,不是渲染之后的
The text was updated successfully, but these errors were encountered: