driver: WebDriver = Chrome(chrome_options=chrome_options)
改成:driver: WebDriver = Chrome(options=chrome_options)
可正常运行
启动 Webdriver 时 :
C:\Users\Arcti\AppData\Local\Programs\Python\Python38\python.exe C:/Users/Arcti/Desktop/WeReadScan/example/demo.py
C:/Users/Arcti/Desktop/WeReadScan/example/demo.py:23: DeprecationWarning: use options instead of chrome_options
driver: WebDriver = Chrome(chrome_options=chrome_options)
Webdriver launching...
Traceback (most recent call last):
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in init
RemoteWebDriver.init(
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init
self.start_session(capabilities, browser_profile)
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 319, in execute
response = self.command_executor.execute(driver_command, params)
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 374, in execute
return self._request(command_info[0], url, body=data)
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 397, in _request
resp = self._conn.request(method, url, body=body, headers=headers)
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\request.py", line 79, in request
return self.request_encode_body(
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\request.py", line 171, in request_encode_body
return self.urlopen(method, url, **extra_kw)
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\poolmanager.py", line 336, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 670, in urlopen
httplib_response = self._make_request(
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 392, in _make_request
conn.request(method, url, **httplib_request_kw)
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1230, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1276, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1225, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1004, in _send_output
self.send(msg)
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 944, in send
self.connect()
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connection.py", line 187, in connect
conn = self._new_conn()
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connection.py", line 159, in _new_conn
conn = connection.create_connection(
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\util\connection.py", line 51, in create_connection
host, port = "address"
ValueError: too many values to unpack (expected 2)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/Arcti/Desktop/WeReadScan/example/demo.py", line 23, in
driver: WebDriver = Chrome(chrome_options=chrome_options)
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 83, in init
self.quit()
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 158, in quit
self.service.stop()
File "C:\Users\Arcti\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\common\service.py", line 147, in stop
if self.process is None:
AttributeError: 'Service' object has no attribute 'process'
Process finished with exit code 1
如何去设置修改这些文件?
才疏学浅,可否把文件打包成exe文件方便学习。