from selenium import webdriver
driver = webdriver.Chrome()
driver.get('http://www.google.com/xhtml');
出现错误提示
"ChromeDriver executable needs to be available in the path. " selenium.common.exceptions.WebDriverException: Message: ChromeDriver executable needs to be available in the path. Please download from http://chromedriver.storage.googleapis.com/index.html and read up at http://code.google.com/p/selenium/wiki/ChromeDriver
解决办法
vim ~/.bash_profile
export PATH=$PATH:ChromeDriver目录(注意,是存放的目录,不是这个文件)
:wq
source ~/.bash_profile
或者
driver = webdriver.Chrome(path)
一定要是下载下来的webdriver的完整路径