-
Notifications
You must be signed in to change notification settings - Fork 246
Open
Labels
Description
the code
package main
import (
"context"
"fmt"
"github.com/chromedp/chromedp"
"os"
)
func run() {
t := "https://www.youtube.com"
allocatorCtx, _ := chromedp.NewRemoteAllocator(context.Background(), "ws://127.0.0.1:9222")
ctx, _ := chromedp.NewContext(allocatorCtx)
var url string
if err := chromedp.Run(ctx, []chromedp.Action{
chromedp.Navigate(t),
// chromedp.Sleep(10 * time.Second),
chromedp.Location(&url),
chromedp.Dump("html", os.Stdout),
}...); err != nil {
fmt.Println("t", err)
}
fmt.Println("URL:", url)
}
func main() {
run()
}
output
t context canceled
URL: https://www.youtube.com/
./lightpanda version
bdc49a6