python+selenium使用Chromedriver驱动
- include the ChromeDriver location in your PATH environment variable
- (Java only) specify its location via the webdriver.chrome.driver system property (see sample below)
- (Python only) include the path to ChromeDriver when instantiating webdriver.Chrome (see sample below)
用python写selenium调用chrome时提示驱动错误,设置驱动的方式如下
https://sites.google.com/a/chromium.org/chromedriver/getting-started
方法一(仅对python有效):
1 |
driver = webdriver.Chrome('/path/to/chromedriver') |
方法二:
将chromedriver移动到/usr/bin下
如果还有问题的话,记得给chromedriver设置可执行权限
1 |
sudo chmod a+x chromedriver |
转载请注明:软件测试 » python+selenium使用Chromedriver驱动