python selenium reports an error ValueError: Timeout value connect was <...>, but it must be an int, float or None.
python selenium reports an error ValueError: Timeout value connect was <...>, but it must be an int, float or None.
Due to changing the system, selenium was reinstalled. Command: pip install selenium.
The default version is selenium4. The version is not compatible, so uninstall: pip uninstall selenium.
Replace with the old version: pip install selenium==3.141.0.
After installation, it displays:
Successfully installed selenium-3.141.0 urllib3-2.0. 2 (The pit has appeared)
After running the code, an error will be reported:
from selenium import webdriver
driver = webdriver.Firefox()
driver.get("https://www.baidu.com")
Error:
ValueError: Timeout value connect was <object object at 0x0000019A00694540>
, but it must be an int, float or None.
In fact, it is an incompatibility problem between the selenium version and the urllib3 version. Change the urllib3 version:
pip uninstall urllib3
pip install urllib3==1.26.2
You can also change the selenium version, refer to the following article:
https://blog.csdn.net/qq_48302722/article/details/130861992