求助,我 selenium webdriver 一直不能运行

本贴最后更新于 544 天前,其中的信息可能已经时移世改

D:\Python\Python38-32\python.exe C:/Users/Windows/PycharmProjects/DEMOCESHI/D1/DEMO1.py
Traceback (most recent call last):
File "C:/Users/Windows/PycharmProjects/DEMOCESHI/D1/DEMO1.py", line 4, in
driver = webdriver.Firefox()
File "D:\Python\Python38-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 170, in init
RemoteWebDriver.init(
File "D:\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init
self.start_session(capabilities, browser_profile)
File "D:\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "D:\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 319, in execute
response = self.command_executor.execute(driver_command, params)
File "D:\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 374, in execute
return self._request(command_info[0], url, body=data)
File "D:\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 397, in _request
resp = self._conn.request(method, url, body=body, headers=headers)
File "D:\Python\Python38-32\lib\site-packages\urllib3_request_methods.py", line 118, in request
return self.request_encode_body(
File "D:\Python\Python38-32\lib\site-packages\urllib3_request_methods.py", line 217, in request_encode_body
return self.urlopen(method, url, **extra_kw)
File "D:\Python\Python38-32\lib\site-packages\urllib3\poolmanager.py", line 422, in urlopen
conn = self.connection_from_host(u.host, port=u.port, scheme=u.scheme)
File "D:\Python\Python38-32\lib\site-packages\urllib3\poolmanager.py", line 303, in connection_from_host
return self.connection_from_context(request_context)
File "D:\Python\Python38-32\lib\site-packages\urllib3\poolmanager.py", line 328, in connection_from_context
return self.connection_from_pool_key(pool_key, request_context=request_context)
File "D:\Python\Python38-32\lib\site-packages\urllib3\poolmanager.py", line 351, in connection_from_pool_key
pool = self._new_pool(scheme, host, port, request_context=request_context)
File "D:\Python\Python38-32\lib\site-packages\urllib3\poolmanager.py", line 265, in _new_pool
return pool_cls(host, port, **request_context)
File "D:\Python\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 196, in __init__
timeout = Timeout.from_float(timeout)
File "D:\Python\Python38-32\lib\site-packages\urllib3\util\timeout.py", line 190, in from_float
return Timeout(read=timeout, connect=timeout)
File "D:\Python\Python38-32\lib\site-packages\urllib3\util\timeout.py", line 119, in __init__
self._connect = self._validate_timeout(connect, "connect")
File "D:\Python\Python38-32\lib\site-packages\urllib3\util\timeout.py", line 156, in _validate_timeout
raise ValueError(
ValueError: Timeout value connect was <object object at 0x00ED68F8>, but it must be an int, float or None.

一直给我弹ValueError?

我selenium版本是3.141.0

浏览器用的火狐版本号是100

  • 待分类
    9719 引用 • 914 回帖 • 5 关注
  • Q&A
    763 引用 • 583 回帖 • 2 关注
1 回帖
请输入回帖内容 ...
  • ZL

    你之前是否安装过高版本的Selenium,如Selenium4+以上的,后面又降低了,Python环境+Selenium全部卸载,重新搭建环境...我之前也用pip安装selenium,发现安装的最新的Selenium4+,后面就运行不了,全部卸载重新搭建就好了....