RequestsDependencyWarning: urllib3 (1.26.11) or chardet (3.0.4) doesn't match a supported version error using Selenium and ChromeDriverManager
Asked Answered
H

2

10

I have this script to acess my internet modem and reboot the device, but stop to work some weeks ago. Here my code:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
service = Service(executable_path=ChromeDriverManager().install())
driver = webdriver.Chrome(service=service)
from selenium.webdriver.common.by import By

chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')

driver = webdriver.Chrome(ChromeDriverManager().install(),options=chrome_options)

driver.get('http://192.168.15.1/me_configuracao_avancada.asp',)
user = driver.find_element(By.ID, "txtUser")
user.send_keys("support")
btnLogin = driver.find_element(By.ID, "btnLogin")
btnLogin.click()
driver.get('http://192.168.15.1/reboot.asp',)
reboot = driver.find_element(By.ID, "btnReboot")
reboot.click()
print("Modem Reiniciado!")

now when i run, this error messages return:

/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.11) or chardet (3.0.4) doesn't match a supported version!
  warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
Traceback (most recent call last):
  File "modem.py", line 7, in <module>
    driver = webdriver.Chrome(service=service)
  File "/home/fabio/.local/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__
    super().__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "/home/fabio/.local/lib/python3.8/site-packages/selenium/webdriver/chromium/webdriver.py", line 92, in __init__
    super().__init__(
  File "/home/fabio/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 277, in __init__
    self.start_session(capabilities, browser_profile)
  File "/home/fabio/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 370, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/home/fabio/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 435, in execute
    self.error_handler.check_response(response)
  File "/home/fabio/.local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally.
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Stacktrace:
#0 0x561e346d9cd3 <unknown>
#1 0x561e344e1968 <unknown>
#2 0x561e3450625c <unknown>
#3 0x561e345018fa <unknown>
#4 0x561e3453c94a <unknown>
#5 0x561e34536aa3 <unknown>
#6 0x561e3450c3fa <unknown>
#7 0x561e3450d555 <unknown>
#8 0x561e347212bd <unknown>
#9 0x561e34725418 <unknown>
#10 0x561e3470b36e <unknown>
#11 0x561e34726078 <unknown>
#12 0x561e346ffbb0 <unknown>
#13 0x561e34742d58 <unknown>
#14 0x561e34742ed8 <unknown>
#15 0x561e3475ccfd <unknown>
#16 0x7fc22f8b9609 <unknown>

Some weeks ago this code run without any problems, but now i'm stuck I'm using Google Chrome 103.0.5060.134 and ChromeDriver 103.0.5060.134.

Hedi answered 1/8, 2022 at 20:40 Comment(2)
Selenium version?Chronicle
selenium==4.3.0Hedi
C
23

This error message...

/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.11) or chardet (3.0.4) doesn't match a supported version!
  warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "

...implies that the requests module is backdated hence not in sync and needs an update.


Solution

You can update the requests module using either of the following commands:

pip3 install requests

or

pip3 install --upgrade requests
Chronicle answered 1/8, 2022 at 20:46 Comment(7)
it was really backdated, I updated here but the error remains, thanks for the suggestion, now requests it's in 2.28.1Hedi
Same error RequestsDependencyWarning?Chronicle
No, this line it's goneHedi
So you are seeing a different error. Can you raise a new question with your new requirement please?Chronicle
Of course, Here it is #73208966Hedi
Doh! I thought requests looked so generic that I didn't stop to think that there's actually a library called that.Disbud
@Disbud Blame it on transitive dependenciesChronicle
N
5

upgrade request i was also encounter the same error but after installing the latest version the error goes **

pip install requests==2.28.1

** https://pypi.org/project/requests/2.28.1/

Numidia answered 18/10, 2022 at 9:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.