selenium3 浏览器驱动的设置

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_28553681/article/details/81240803

selenium3之后就没有提供默认的浏览器驱动了,需要下载相应的驱动才能操作浏览器;

针对Firefox浏览器驱动;

1、java版本:

System.setProperty("webdriver.gecko.driver","F:\\selenium3.12test\\geckodriver-v0.20.0-win64\\geckodriver.exe");

2、python版本:

webdriver.Firefox(executable_path="E:\\work_tool\\java\selenium\\geckodriver-v0.20.0-win64\\geckodriver")

或者将geckodriver放到python根目录下也是可以的。

猜你喜欢

转载自blog.csdn.net/qq_28553681/article/details/81240803
今日推荐