go-rod / rod

A Chrome DevTools Protocol driver for web automation and scraping.

Home Page:https://go-rod.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

似乎无法得到渲染数据

mumodenan opened this issue · comments

正常curl 可以得到文本数据, 通过渲染反而丢失了

package main

import (
	"fmt"
	"os"
	"time"
	"github.com/go-rod/rod"
)

func main() {
	b := rod.New().ControlURL("ws://127.0.0.1:9222/devtools/browser/6cd8b2a3-ed71-42aa-910b-e554015f772b").MustConnect()
	page := b.MustPage("https://wenku.baidu.com/view/98593fe25ff7ba0d4a7302768e9951e79b896989.html?fr=hp_Database&_wkts_=1699522656597&needWelcomeRecommand=1")
	page = page.MustWaitLoad()
	page.MustScreenshot("a.jpg")
	os.Remove("test.html")
	fd, _ := os.Create("test.html")
	html, _ := page.HTML()
	fd.WriteString(html)
	page.Close()

}
`

Rod Version:  v0.114.2

v0.114.2

Please add a valid Rod Version: v0.0.0 to your issue. Current version is v0.114.5

Please fix the format of your markdown:

2 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```jsx"]

generated by check-issue