go-rod / rod

A Chrome DevTools Protocol driver for web automation and scraping.
https://go-rod.github.io
MIT License
5.23k stars 344 forks source link

渲染有问题 #974

Closed mumodenan closed 10 months ago

mumodenan commented 10 months ago

Rod Version: v0.114.2

正常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()

}
`
github-actions[bot] commented 10 months ago

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:

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

generated by check-issue

ysmood commented 10 months ago

Duplicated with #973