如何在python 2.7中使用selenium模块打开Web浏览器?

时间:2018-06-18 12:01:06

标签: python-2.7 selenium

我有以下代码。我正在尝试在python中使用selenium。

代码段:

from selenium import webdriver

browser= webdriver.Chrome()
browser.get('http://www.google.com/')

错误:

  

C:\ Users \ xsat082 \ Desktop \ fetchingurl> python fetchingsubdivurl.py   Traceback(最近一次调用最后一次):     文件" fetchingsubdivurl.py",第5行,in       浏览器= webdriver.Chrome()     文件" C:\ Users \ xsat082 \ Desktop \ fetchingurl \ selenium \ webdriver \ chrome \ webdriver.py",第68行, init       self.service.start()     文件" C:\ Users \ xsat082 \ Desktop \ fetchingurl \ selenium \ webdriver \ common \ service.py",第83行,开始       os.path.basename(self.path),self.start_error_message)   selenium.common.exceptions.WebDriverException:消息:' chromedriver'可执行文件需要在PATH中。请参阅https://sites.google.com/a/chromium.org/chromedriver

请建议我如何克服这个问题?

由于 Simun

0 个答案:

没有答案