Updating README.md with latest examples/simple/main.go
This commit is contained in:
parent
68bf958ce3
commit
dba0e6c45a
|
@ -46,7 +46,7 @@ func main() {
|
|||
defer cancel()
|
||||
|
||||
// create chrome instance
|
||||
c, err := cdp.New(ctxt)
|
||||
c, err := cdp.New(ctxt, cdp.WithLog(log.Printf))
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ func googleSearch(q, text string, site, res *string) cdp.Tasks {
|
|||
cdp.WaitNotVisible(`div.v-middle > div.la-ball-clip-rotate`, cdp.ByQuery),
|
||||
cdp.Location(site),
|
||||
cdp.Screenshot(`#testimonials`, &buf, cdp.ByID),
|
||||
cdp.ActionFunc(func(context.Context, cdptypes.FrameHandler) error {
|
||||
cdp.ActionFunc(func(context.Context, cdptypes.Handler) error {
|
||||
return ioutil.WriteFile("testimonials.png", buf, 0644)
|
||||
}),
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user