Today, we are using selenium + WebDriver to open chrome. The Code is as follows:
From selenium import WebDriver
Driver = WebDriver. Chrome ()
Driver. Get ("www.google.com ")
After running the code, the following error occurs:
Traceback (most recent call last ):
File "/selenium_python/forward_url.py", line 7, in <module>
Driver = WebDriver. Chrome ()
File "/usr/local/lib/python2.7/dist-packages/selenium/WebDriver/Chrome/WebDriver. py", line 60, in _ init __
Self. Service. Start ()
File "/usr/local/lib/python2.7/dist-packages/selenium/WebDriver/Chrome/service. py", line 68, in start
And read up at http://code.google.com/p/selenium/wiki/ChromeDriver ")
Selenium. Common. Exceptions. webdriverexception: Message: 'chromedriver executable needs to be available in the path. Please download from http://code.google.com/p/selenium/downloads/list and read up at http://code.google.com/p/selenium/wiki/chromedriver'
If the prompt chrome driver is not placed in the correct path, download chrome dirver and place it in the/usr/bin directory. Then, run it again!
OS |
Expected location of chrome |
Linux |
/Usr/bin/google-chrome1 |
Mac |
/Applications/Google \ chrome. APP/contents/MACOs/Google \ chrome |
Windows XP |
% Homepath % \ Local Settings \ Application Data \ google \ chrome \ Application \ chrome.exe |
Windows Vista |
C: \ Users \ % username % \ appdata \ Local \ google \ chrome \ Application \ chrome.exe |
This table indicates that Google-chrome should be placed in the/usr/bin directory under Ubuntu.