Skip to content

Instantly share code, notes, and snippets.

@wpajqz
Last active August 19, 2020 23:20
Show Gist options
  • Save wpajqz/45789f7e99df782cca2cb9a926770a00 to your computer and use it in GitHub Desktop.
Save wpajqz/45789f7e99df782cca2cb9a926770a00 to your computer and use it in GitHub Desktop.
package main
func main() {
ctx := context.Background()
devTools := devtool.New("http://127.0.0.1:9222")
pt, err := devTools.Get(ctx, devtool.Page)
if err != nil {
pt, err = devTools.Create(ctx)
if err != nil {
panic(err)
}
}
allocCtx, cancel := chromedp.NewRemoteAllocator(context.Background(), pt.WebSocketDebuggerURL)
defer cancel()
}
@mperezguendulain
Copy link

Hi, thanks for showing how to obtain the WebSocketDebuggerURL, I have a question, the devtool package is from https://godoc.org/github.com/mafredri/cdp/devtool right?

@cxnky
Copy link

cxnky commented Aug 19, 2020

seems to not be working
2020/08/19 23:18:34 invalid context on line 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment