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 chrome driver #226

Closed
krishna3008 opened this issue Oct 4, 2021 · 4 comments · Fixed by #253
Closed

Failed to install chrome driver #226

krishna3008 opened this issue Oct 4, 2021 · 4 comments · Fixed by #253
Assignees

Comments

@krishna3008
Copy link

My code:
`from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager

driver = webdriver.Chrome(ChromeDriverManager().install())
driver.close()`

Below is the Console output

====== WebDriver manager ======
Current google-chrome version is 93.0.4577
Get LATEST driver version for 93.0.4577
Traceback (most recent call last):
File "C:\Users\qjq2g6\AppData\Roaming\Python\Python39\site-packages\urllib3\connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "C:\Users\qjq2g6\AppData\Roaming\Python\Python39\site-packages\urllib3\connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "C:\Users\qjq2g6\AppData\Roaming\Python\Python39\site-packages\urllib3\connectionpool.py", line 1010, in validate_conn
conn.connect()
File "C:\Users\qjq2g6\AppData\Roaming\Python\Python39\site-packages\urllib3\connection.py", line 416, in connect
self.sock = ssl_wrap_socket(
File "C:\Users\qjq2g6\AppData\Roaming\Python\Python39\site-packages\urllib3\util\ssl
.py", line 449, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(
File "C:\Users\qjq2g6\AppData\Roaming\Python\Python39\site-packages\urllib3\util\ssl
.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "C:\Program Files\Python39\lib\ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "C:\Program Files\Python39\lib\ssl.py", line 1040, in _create
self.do_handshake()
File "C:\Program Files\Python39\lib\ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\qjq2g6\AppData\Roaming\Python\Python39\site-packages\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "C:\Users\qjq2g6\AppData\Roaming\Python\Python39\site-packages\urllib3\connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "C:\Users\qjq2g6\AppData\Roaming\Python\Python39\site-packages\urllib3\util\retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='chromedriver.storage.googleapis.com', port=443): Max retries exceeded with url: /LATEST_RELEASE_93.0.4577 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\qjq2g6\Desktop\Chrmoe_download.py", line 4, in
driver = webdriver.Chrome(ChromeDriverManager().install())
File "C:\Users\qjq2g6\AppData\Roaming\Python\Python39\site-packages\webdriver_manager\chrome.py", line 34, in install
driver_path = self._get_driver_path(self.driver)
File "C:\Users\qjq2g6\AppData\Roaming\Python\Python39\site-packages\webdriver_manager\manager.py", line 23, in _get_driver_path
driver_version = driver.get_version()
File "C:\Users\qjq2g6\AppData\Roaming\Python\Python39\site-packages\webdriver_manager\driver.py", line 43, in get_version
return self.get_latest_release_version()
File "C:\Users\qjq2g6\AppData\Roaming\Python\Python39\site-packages\webdriver_manager\driver.py", line 66, in get_latest_release_version
resp = requests.get(f"{self.latest_release_url}{self.browser_version}")
File "C:\Users\qjq2g6\AppData\Roaming\Python\Python39\site-packages\requests\api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "C:\Users\qjq2g6\AppData\Roaming\Python\Python39\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\qjq2g6\AppData\Roaming\Python\Python39\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\qjq2g6\AppData\Roaming\Python\Python39\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "C:\Users\qjq2g6\AppData\Roaming\Python\Python39\site-packages\requests\adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='chromedriver.storage.googleapis.com', port=443): Max retries exceeded with url: /LATEST_RELEASE_93.0.4577 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)')))

@aleksandr-kotlyar
Copy link
Collaborator

aleksandr-kotlyar commented Oct 6, 2021

@krishna3008 are you running from proxy? Or from VPN? Or from corporate network?
It was a world-global issue 30 september - 1 october with certificates. Check this out https://www.google.com/search?q=ssl+error+letsencrypt

What version of openssl do you use? Probably check for your openssl library version - and update it - this can help if you are not behind the proxy/vpn.
https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/

In CI tests are passing and from local network too. So it seems it's your local issue.

Please check the articles from above and come back if you solve/not solve the issue.

@miguelius
Copy link

miguelius commented Oct 15, 2021

This can be fixed using pr #225.

from webdriver_manager.chrome import ChromeDriverManager

driver = webdriver.Chrome(ChromeDriverManager().dont_verify_ssl().install())
driver.close()

If you need to parametrize the request session, you can call the function session() and you'll get the session used by both the Manager and download_file function.

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)
@TshokeloMokubi
Copy link

This can be fixed using pr #225.

from webdriver_manager.chrome import ChromeDriverManager

driver = webdriver.Chrome(ChromeDriverManager().dont_verify_ssl().install())
driver.close()

If you need to parametrize the request session, you can call the function session() and you'll get the session used by both the Manager and download_file function.

Is it safe to use 'dont_verify_ssl()'?

@miguelius
Copy link

miguelius commented Apr 25, 2022 via email

@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
Development

Successfully merging a pull request may close this issue.

4 participants