docker run -itd --name rod --net host --restart always 740162752/rod:latest
package main
import (
"fmt"
"github.com/go-rod/rod"
"github.com/go-rod/rod/lib/launcher"
)
func main() {
l := launcher.MustNewManaged("http://localhost:9222")
browser := rod.New().Client(l.MustClient()).MustConnect()
//fmt.Println(browser.MustPage("https://www.baidu.com").MustEval("()=>document.title"))
page := browser.MustPage("https://www.baidu.com")
title := page.MustWaitLoad().MustInfo().Title
fmt.Println(title)
}
Content type
Image
Digest
Size
258.7 MB
Last updated
over 4 years ago
docker pull 740162752/rod