0

I have the following code.I am trying to use selenium in python.

Code snippet:

from selenium import webdriver

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

Error:

C:\Users\xsat082\Desktop\fetchingurl>python fetchingsubdivurl.py Traceback (most recent call last): File "fetchingsubdivurl.py", line 5, in browser=webdriver.Chrome() File "C:\Users\xsat082\Desktop\fetchingurl\selenium\webdriver\chrome\webdriver.py", line 68, in init self.service.start() File "C:\Users\xsat082\Desktop\fetchingurl\selenium\webdriver\common\service.py", line 83, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver

Please suggest me how to overcome this issue?

Thanks Simun

Jinto Jacob
  • 385
  • 2
  • 17
user3664681
  • 171
  • 1
  • 3
  • 13
  • Hi Debanjan, I am running the python script on python2.7. (windows7 OS)following error has been observed. selenium.common.exceptions.WebDriverException: Message: Service C:\Program Files (x86)\Google\Chrome\Application\chrome.exe unexpectedly exited. Status code was: 0 – user3664681 Jun 18 '18 at 12:28
  • Also it opened the chrome but not the url i have entered on get().from selenium import webdriver options = webdriver.ChromeOptions() options.add_argument('user-agent = Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36') driver = webdriver.Chrome(chrome_options=options, executable_path=r'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe') driver.get('http://www.google.com ') print("Chrome Browser Initialized in Headless Mode") driver.quit() print("Driver Exited") – user3664681 Jun 18 '18 at 12:30
  • This question was with respect to the error message **'chromedriver' executable needs to be in PATH**. Your current error seems to be **Service C:\Program Files (x86)\Google\Chrome\Application\chrome.exe unexpectedly exited. Status code was: 0**. If your requirement have changed raise a new question as per your new requirement – undetected Selenium Jun 18 '18 at 12:51

0 Answers0