Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Selenium webdriver error
Hi guys,
I'm very new to Python - trying to use Selenium to scrape dynamic web pages and can't even get over 1st hurdle!!!
from selenium import webdriver
browser = webdriver.Chrome('C:\Program Files (x86)\Google\Chrome\Application\chrome.exe')
The browser opens but does not connect to the requested web page and I get the following error:

Traceback (most recent call last): File "C:\Users\Shane Duncan\OneDrive\Documents\Trading\MyFxBook Programs\Test", line 32, in <module> browser = webdriver.Chrome('C:\Program Files (x86)\Google\Chrome\Application\chrome.exe') File "C:\Users\Shane Duncan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\chrome\", line 73, in __init__ self.service.start() File "C:\Users\Shane Duncan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\common\", line 98, in start self.assert_process_still_running() File "C:\Users\Shane Duncan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\common\", line 111, in assert_process_still_running % (self.path, return_code) selenium.common.exceptions.WebDriverException: Message: Service C:\Program Files (x86)\Google\Chrome\Application\chrome.exe unexpectedly exited. Status code was: 0
I have no idea why I get this error - any help appreciated.
you need to download chromedriver and link to that, not your local chrome exe
I ran the chromedriver exe file and it opens the cmd window and just sits there
I ran the python code again and same error as before.
(Feb-09-2020, 11:07 AM)WiPi Wrote: I ran the chromedriver exe file and it opens the cmd window and just sits there
You dont run that directly, you put it in your code's path. Or you can add the chromedriver's directory to Windows PATH variable to not have to put the path in your code.
sorry yes I realised later doh!

Thank you this now works but I am sure I will have plenty more stupid questions as I get into the tough stuff!

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  error when running headless selenium julio2000 2 138 Feb-01-2020, 12:41 PM
Last Post: julio2000
  Error clicking button with selenium julio2000 4 211 Jan-06-2020, 10:59 AM
Last Post: julio2000
  Selenium error with ebdriver (geckodriver) Martinelli 4 662 Sep-24-2019, 01:40 AM
Last Post: Martinelli
  Python Selenium .click() Loads Error - Works Manually.- Events not Triggered NSearch 24 1,658 Aug-14-2019, 02:23 PM
Last Post: NSearch
  Can not point to Selenium Webdriver path for Python Jupyter Notebook on Azure dadadance 4 3,041 Jul-31-2019, 10:00 PM
Last Post: perfringo
  Error when trying to use Selenium ejected 1 1,449 Mar-26-2019, 04:53 AM
Last Post: ejected
  Selenium Webdriver Memory Problem? satbir129 2 686 Mar-01-2019, 04:17 AM
Last Post: satbir129
  Selenium Webdriver Automate gahhon 1 503 Feb-19-2019, 04:59 PM
Last Post: metulburr
  Instagramlogin Error (Selenium) julian_veit 0 524 Jan-26-2019, 02:40 PM
Last Post: julian_veit
  selenium error : evilcode1 7 1,217 Nov-12-2018, 01:08 PM
Last Post: snippsat

Forum Jump:

Users browsing this thread: 1 Guest(s)