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
  How do I iterate over an array and perform actions using selenium chrome webdriver? master 0 92 Sep-14-2020, 05:28 AM
Last Post: master
  Which webdriver is required for selenium in Pydroid App Rahatt 1 247 Jul-31-2020, 01:39 AM
Last Post: Larz60+
  Log In Button Won't Click - Python Selenium Webdriver samlee916 2 505 Jun-07-2020, 04:42 PM
Last Post: samlee916
  Hyperlink Click is not working in Selenium webdriver rajeev1729 0 264 May-02-2020, 11:21 AM
Last Post: rajeev1729
  Selenium weird error julio2000 0 277 Feb-23-2020, 01:24 PM
Last Post: julio2000
  error when running headless selenium julio2000 2 423 Feb-01-2020, 12:41 PM
Last Post: julio2000
  Error clicking button with selenium julio2000 4 1,669 Jan-06-2020, 10:59 AM
Last Post: julio2000
  Selenium error with ebdriver (geckodriver) Martinelli 4 1,293 Sep-24-2019, 01:40 AM
Last Post: Martinelli
  Python Selenium .click() Loads Error - Works Manually.- Events not Triggered NSearch 24 2,924 Aug-14-2019, 02:23 PM
Last Post: NSearch
  Can not point to Selenium Webdriver path for Python Jupyter Notebook on Azure dadadance 4 4,678 Jul-31-2019, 10:00 PM
Last Post: perfringo

Forum Jump:

Users browsing this thread: 1 Guest(s)