Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Web Page not opening while web scraping through python selenium
I am writing codes to do web crawling in windows environment, and using google chrome and mozila firefox as browser. For google chrome I downloaded latest chromedriver and the latest geckodriver for firefox and added path of these drivers in the environment variables.
A sample code is given below which I am executing for google chrome -

from selenium import webdriver

driver = webdriver.Chrome("C:\\ChromeDriver\\chromedriver.exe")
In this case the web browser is opening but the google page didn't opened and the whole page remains white after staying like this for certain times the below error is coming. The image of the browser is attached.
c:\ChromeDriver>python [4064:8324:1119/] Failed to read HKLM\SOFTWARE\Policies\Google\Chrome\MachineLevelUserCloudPolicyEnrollmentToken: The system cannot find the file specified. (0x2) DevTools listening on ws:// Traceback (most recent call last): File "", line 3, in <module> driver = webdriver.Chrome("C:\\ChromeDriver\\chromedriver.exe") File "C:\Users\CSURV5\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\chrome\", line 81, in __init__ desired_capabilities=desired_capabilities) File "C:\Users\CSURV5\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\", line 157, in __init__ self.start_session(capabilities, browser_profile) File "C:\Users\CSURV5\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "C:\Users\CSURV5\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\", line 321, in execute self.error_handler.check_response(response) File "C:\Users\CSURV5\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: chrome not reachable (Driver info: chromedriver=2.43.600210 (68dcf5eebde37173d4027fa8635e332711d2874a),platform=Windows NT 10.0.17134 x86_64)
The below code is for the firefox -
from selenium import webdriver

driver = webdriver.Firefox("C:\\ChromeDriver\\")
I am not getting any output after executing the code, even the browser is not also opening. After some time this error message has been thrown.
Traceback (most recent call last): File "", line 3, in <module> driver = webdriver.Firefox("C:\\ChromeDriver\\") File "C:\Users\CSURV5\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\firefox\", line 164, in __init__ self.service.start() File "C:\Users\CSURV5\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\common\", line 104, in start raise WebDriverException("Can not connect to the Service %s" % self.path) selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service geckodriver
Please let me know the exact reason, why I am getting these error?

Attached Files Thumbnail(s)
Quote:driver = webdriver.Chrome("C:\\ChromeDriver\\chromedriver.exe")
what is the permissions of C:\ChromeDirver?

driver = webdriver.Firefox("C:\\ChromeDriver\\")
As for firefox it appears you are just passing the same directory to it. Where is geckodriver?
(Nov-19-2018, 12:23 PM)metulburr Wrote:
Quote:what is the permissions of C:\ChromeDirver?

The directory ChromeDriver has full permission.

Quote:As for firefox it appears you are just passing the same directory to it. Where is geckodriver?
geckodriver and chromedriver is in the same directory C:\ChromeDriver
(Nov-19-2018, 10:57 AM)sumandas89 Wrote: Failed to read HKLM\SOFTWARE\Policies\Google\Chrome\MachineLevelUserCloudPolicyEnrollmentToken:
It complains that you don't have this key is register.
I check i don't have this key,but work fine without for me.
Try add key to register follow this.

Also basic stuff if you make a folder ChromeDriver with chrome and gecko driver in it,you will need to add that path(C:\ChromeDriver) to Windows Path(Restart Pc).
How to Edit/Add Your System PATH

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Selenium get data from newly accessed page hoff1022 2 171 Oct-09-2019, 06:52 PM
Last Post: hoff1022
  Scraping data from ebay seller page yuvalta 3 2,146 Sep-25-2019, 04:22 AM
Last Post: sandramoraes
  Web scraping (selenium (i think)) Larz60+ 10 1,252 Jan-27-2019, 02:57 AM
Last Post: Larz60+
  Selenium Parsing (unable to Parse page after loading) oneclick 6 821 Jan-13-2019, 03:10 AM
Last Post: oneclick
  Difficult web page -- Selenium Larz60+ 2 504 Dec-31-2018, 06:51 PM
Last Post: Larz60+
  web scraping with selenium and bs4 Prince_Bhatia 2 1,060 Sep-18-2018, 10:59 AM
Last Post: Prince_Bhatia
  Selenium opening pdf in new window test 6 1,325 Sep-15-2018, 07:55 PM
Last Post: test
  Saving html page and reloading into selenium while developing all xpaths Larz60+ 3 674 Sep-10-2018, 01:14 PM
Last Post: snippsat
  Project: Opening all links within a web page Truman 0 532 Aug-07-2018, 12:33 AM
Last Post: Truman
  open a web page by selenium !! evilcode1 3 733 Aug-01-2018, 03:05 PM
Last Post: snippsat

Forum Jump:

Users browsing this thread: 1 Guest(s)