草庐IT

ActionFunc

全部标签

go - Chromedp 不在 ActionFunc 的循环内执行操作

我有一个包含术语列表的slice,我想在某个搜索引擎页面中搜索每个术语,所以我这样做:funcrisk(slice[]string)chromedp.Tasks{returnchromedp.Tasks{chromedp.Navigate("https://testpage"),chromedp.WaitVisible("#query_box",chromedp.ByID),chromedp.ActionFunc(func(context.Context,cdp.Executor)error{for_,element:=rangeslice[2:]{fmt.Println(elemen