So i wanted to use splinter for web browser automation. and it is just not working

1k views Asked by At

The Splinter Documentation states that:: Splinter Documentation instructions for chrome drivers

And so i added the path. :: Path of the environment variable where chrome driver is located

My code :

from splinter import Browser
executable_path = {'executable_path':'C:\Program Files (x86)\Google\Chrome\Application\chrome'}
browser = Browser('chrome', **executable_path)
browser.visit('https://google.com')

But when I run it I get this error :

"C:\Program Files\Python35\python.exe" C:/Users/vedan/PycharmProjects/erevna/erevna-splinter.py
Traceback (most recent call last):
File "C:/Users/vedan/PycharmProjects/erevna/erevna-splinter.py", line 4, in <module>
browser = Browser('chrome', **executable_path)
File "C:\Program Files\Python35\lib\site-packages\splinter\browser.py", line 63, in Browser
return driver(*args, **kwargs)
File "C:\Program Files\Python35\lib\site-packages\splinter\driver\webdriver\chrome.py", line 31, in __init__
self.driver = Chrome(chrome_options=options, **kwargs)
File "C:\Program Files\Python35\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 62, in __init__
self.service.start()
File "C:\Program Files\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 96, in start
self.assert_process_still_running()
File "C:\Program Files\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 109, in assert_process_still_running
% (self.path, return_code)
selenium.common.exceptions.WebDriverException: Message: Service C:\Program Files (x86)\Google\Chrome\Application\chrome unexpectedly exited. Status code was: 0
Process finished with exit code 1

I have no idea what to do

1

There are 1 answers

0
AudioBubble On BEST ANSWER

I had the same trouble with google chrome. In my case this happened due to chromium driver version. But this was solved after updating that. Probably this issue between chrome driver and chrome. Maybe it will be helpful to you. You can download latest version from here: https://github.com/peterhudec/chromedriver_installer.git