Hi all I\'m very new to this and am having issues getting an instance of a Chrome browser from selenium in python. I\'m using Windows 8. I have downloaded the chromedriver b
I used the following and it worked! Thanks!
driver = webdriver.Chrome(executable_path=r'C:\chromedriver.exe')
#put your own path between the ''
Assuming that your path is correct, make sure that you include the chromedriver itself: chromedriver.exe
Update 2016
The following solution works for me, with WebDriver 3.0.1, Chrome Driver 2.25.426923, Window 7
System.setProperty("webdriver.chrome.driver","D:\\workspace\\chromedriver.exe");
WebDriver driver;
driver = new ChromeDriver();
*Note:
Two ways to set it, you somehow mixed up.
Put the chromedriver.exe
's path into PATH
(on Windows), so your PATH
setting is correct, but you need to call the default constructor.
driver = webdriver.Chrome()
Specify the path in webdriver.Chrome(executable_path='some path')
. Here you need the full path to the executable, not the directory.
webdriver.Chrome(executable_path=r'C:\Users\HaranKumar\Downloads\chromedriver_win32_2.0\chromedriver.exe')
Choose either one you want.
for python(selenium) you will need:
from selenium import webdriver
from selenium.webdriver import Chrome
from selenium.webdriver.chrome.options import Options
then put your chromedriver.exe path in. the "r" is just to prevent it from detecting the \ and causing errors in python
PATH = r"C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)
options = webdriver.ChromeOptions()
you can now order the driver to get websites
driver.get('http://www.google.com')
Even if you have chromedriver.exe in the PATH, its necessary to have chromedriver.exe in the folder where your executable scripts are present(atleast so is the case when it comes to python scripts)