Updating README.md with latest examples/simple/main.go

This commit is contained in:
Kenneth Shaw 2017-06-18 08:12:33 +07:00
parent 68bf958ce3
commit dba0e6c45a

View File

@ -46,7 +46,7 @@ func main() {
defer cancel() defer cancel()
// create chrome instance // create chrome instance
c, err := cdp.New(ctxt) c, err := cdp.New(ctxt, cdp.WithLog(log.Printf))
if err != nil { if err != nil {
log.Fatal(err) 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.WaitNotVisible(`div.v-middle > div.la-ball-clip-rotate`, cdp.ByQuery),
cdp.Location(site), cdp.Location(site),
cdp.Screenshot(`#testimonials`, &buf, cdp.ByID), 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) return ioutil.WriteFile("testimonials.png", buf, 0644)
}), }),
} }