我使用selenium golang webdriver示例。package mainimport ( "github.com/fedesog/webdriver" "log" "time")func main() { chromeDriver := webdriver.NewChromeDriver("/path/To/Chrome/Driver/chromedriver") err := chromeDriver.Start() if err != nil { log.Println(err) } desired := webdriver.Capabilities{"Platform": "Linux"} required := webdriver.Capabilities{} session, err := chromeDriver.NewSession(desired, required) if err != nil { log.Println(err) } err = session.Url("http://golang.org") if err != nil { log.Println(err) } time.Sleep(10 * time.Second) session.Delete() chromeDriver.Stop()}它有效但记录错误:Port not available. Exiting..完整输出是:Starting ChromeDriver (v2.9.248307) on port 9515Port not available. Exiting...
- 2 回答
- 0 关注
- 238 浏览
添加回答
举报
0/150
提交
取消