shadowmoose / pyderman

Install Selenium-compatible Chrome/Firefox/Opera/PhantomJS/Edge webdrivers automatically.
MIT License
29 stars 11 forks source link

Unable to locate latest ChromeDriver version. #8

Closed hadi16 closed 4 years ago

hadi16 commented 4 years ago

I am getting the following error when I try to install ChromeDriver using the Python REPL on my machine. I am running Python 3.7.6 on macOS Mojave (10.14.6).

Python 3.7.6 (v3.7.6:43364a7ae0, Dec 18 2019, 14:18:50) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyderman as driver
>>> path = driver.install(browser=driver.chrome)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyderman/__init__.py", line 46, in install
    data = browser.get_url(version=version, _os=_current_os, _os_bit=_os_bit)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyderman/drivers/chrome.py", line 11, in get_url
    raise Exception("Unable to locate latest ChromeDriver version!")
Exception: Unable to locate latest ChromeDriver version!
shadowmoose commented 4 years ago

Hey, when you visit https://chromedriver.storage.googleapis.com/LATEST_RELEASE are you able to see a release version string there?

hadi16 commented 4 years ago

Yes, I see the following when I visit this page: 80.0.3987.106

hadi16 commented 4 years ago

This function within _open() in downloader.py is raising an Exception (which results in None being returned):

def _open(url):
    # noinspection PyBroadException
    try:
        return urlopen(url, timeout=15)
    except Exception:
        return None

This is surprising, since the URL seems right (and this function just calls a native Python function)...

hadi16 commented 4 years ago

Here is the specific exception that is thrown: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)>

shadowmoose commented 4 years ago

Thanks for digging into this issue's root cause. It's very difficult for me to replicate, because the test cases seem to be working fine across all platforms.

Have you tried the solutions proposed here? This may be a setup-specific bug.

hadi16 commented 4 years ago

Yes, this was indeed the issue. It would be very helpful to include this as a debugging FAQ within the readme for the project. Thank you!