daOnlyBG daOnlyBG - 4 years ago 143
Python Question

Selenium Chromedriver launches Chrome, but doesn't open website (new Chromedriver, same old issue)

I am having trouble using Selenium Chromedriver on Windows 7. To display the problem, I've boiled it down to a simple script to simply launch the New York Times website:

from selenium import webdriver

# --LOCATIONS --
# The Chrome app:
# C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
# The Chrome binary:
# C:\Python27\Scripts\chromedriver.exe

chromedriver_path = "C:\Python27\Scripts\chromedriver.exe"

driver = webdriver.Chrome(executable_path=chromedriver_path)

driver.get('https://www.nytimes.com/')


The Chrome Browser launches (leading me to speculate that there's nothing with the Chrome application path), but rather than going to the NYT website, the following happens:

enter image description here

The string
data:,
appears in the URL address bar, and 2 alert notifications come up: one that says "You are using an unsupported command-line flag: --ignore-certificate-errors. Stability and security will suffer." and another that says "Disable developer mode extensions: Extensions running in developer mode can harm your computer. If you're not a developer, you should disable these extensions running in developer mode to stay safe."

This didn't happen when I used Selenium for Firefox- so I'm not sure what to do with Chrome. I've tried looking this issue up on the internet beforehand, but all the issues/solutions are dated from a few years back (2014-2015), and I believe the Selenium packages and Chromedriver binaries have been updated since then.

Does anyone know how I can get my code working? Thank you in advance.

Answer Source

I'd have to see your computer to examine how Chromedriver is installed, but as that's not quite feasible, I would at least recommend uninstalling any chromedriver executables on your computer and then downloading it into your project's directory.

It's really just an IT rule-of-thumb; if you've ruled out every other issue that you're aware of, then there's a good chance the problem is something you're not recognizing. Start at square 1 and reinstall Chromedriver.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download