Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to install geckodriver #219

Closed
batu1579 opened this issue Aug 12, 2021 · 3 comments · Fixed by #253
Closed

failed to install geckodriver #219

batu1579 opened this issue Aug 12, 2021 · 3 comments · Fixed by #253
Assignees

Comments

@batu1579
Copy link

hi there:

its a great package. it is very convenient for me to update the drivers. it works perfectly when downloading the Edge and Chrome drivers. but when i used this package to automatically download firefox drivers. unable to download and reported the following error:

[WDM] - Trying to download new driver from https://github.com/mozilla/geckodriver/releases/download/v0.29.1/geckodriver-v0.29.1-win64.zip
Traceback (most recent call last):
  File "E:\Python3\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
    httplib_response = self._make_request(conn, method, url,
  File "E:\Python3\lib\site-packages\urllib3\connectionpool.py", line 344, in _make_request
    self._validate_conn(conn)
  File "E:\Python3\lib\site-packages\urllib3\connectionpool.py", line 843, in _validate_conn
    conn.connect()
  File "E:\Python3\lib\site-packages\urllib3\connection.py", line 362, in connect
    self.sock = ssl_wrap_socket(
  File "E:\Python3\lib\site-packages\urllib3\util\ssl_.py", line 355, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "E:\Python3\lib\ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "E:\Python3\lib\ssl.py", line 1040, in _create
    self.do_handshake()
  File "E:\Python3\lib\ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\Python3\lib\site-packages\requests\adapters.py", line 439, in send
    resp = conn.urlopen(
  File "E:\Python3\lib\site-packages\urllib3\connectionpool.py", line 640, in urlopen
    retries = retries.increment(method, url, error=e, _pool=self,
  File "E:\Python3\lib\site-packages\urllib3\util\retry.py", line 399, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='github.com', port=443): Max retries exceeded with url: /mozilla/geckodriver/releases/download/v0.29.1/geckodriver-v0.29.1-win64.zip (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Github\NCUT-library-auto-answer\main.py", line 309, in <module>
    browser = get_broswer()
  File "D:\Github\NCUT-library-auto-answer\library\get_driver.py", line 65, in get_broswer
    driver_path = Manager(
  File "E:\Python3\lib\site-packages\webdriver_manager\firefox.py", line 31, in install
    return self._get_driver_path(self.driver)
  File "E:\Python3\lib\site-packages\webdriver_manager\manager.py", line 30, in _get_driver_path
    file = download_file(driver.get_url())
  File "E:\Python3\lib\site-packages\webdriver_manager\utils.py", line 92, in download_file
    response = requests.get(url, stream=True)
  File "E:\Python3\lib\site-packages\requests\api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "E:\Python3\lib\site-packages\requests\api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "E:\Python3\lib\site-packages\requests\sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "E:\Python3\lib\site-packages\requests\sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "E:\Python3\lib\site-packages\requests\adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='github.com', port=443): Max retries exceeded with url: /mozilla/geckodriver/releases/download/v0.29.1/geckodriver-v0.29.1-win64.zip (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))

here are my codes:

    driver_path = g.DRIVER_PATH
    if driver_path == "":
        driver_path = Manager(
            path=".\\src",
            print_first_line=False,
            cache_valid_range=10,
        ).install()

if don’t know if this is my problem, could you help me thank you !

@aleksandr-kotlyar
Copy link
Collaborator

aleksandr-kotlyar commented Aug 14, 2021

Hi @batu1579 !
Please read the docs in https://github.com/SergeyPirogov/webdriver_manager/blob/master/README.md#configuration
Your problem is that you exceeded amount of anonymous downloads from github.
You need to setup GH_TOKEN variable in your system environment.
Have a good day!

@batu1579
Copy link
Author

hello @aleksandr-kotlyar !

Thanks for your help, but I still get the same error after setting the environment variable. I checked the information and found that it seems to be caused by SSL authentication failure. So I disable SSL authentication at the error point (line 93 in utils.py).

From this:

response = requests.get(url, stream=True)

To this:

response = requests.get(url, stream=True, verify=False)

It looks like the problem has been resolved, but I still don't know why: I can open Github and manually download the file, but I can't get the file using request. I am very confused. :(

@miguelius
Copy link

miguelius commented Sep 20, 2021

Issue seems to be related to a proxy. Are you working behind a proxy intercepting https requests?

An improvement to this great library would be adding some parameter to customize the requests session object.

aleksandr-kotlyar added a commit to aleksandr-kotlyar/webdriver_manager that referenced this issue Oct 18, 2021
- to disable request ssl verification (feature to fix issues SergeyPirogov#219, SergeyPirogov#226)
aleksandr-kotlyar added a commit to aleksandr-kotlyar/webdriver_manager that referenced this issue Oct 19, 2021
Details: add WDM_SSL_VERIFY env property to disable requests ssl verification (feature to fix issues SergeyPirogov#219, SergeyPirogov#226)
SergeyPirogov pushed a commit that referenced this issue Oct 19, 2021
Details: add WDM_SSL_VERIFY env property to disable requests ssl verification (feature to fix issues #219, #226)
@aleksandr-kotlyar aleksandr-kotlyar self-assigned this May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants