代码如下:
from selenium import webdriver b = webdriver.Chrome() b.get('http://192.168.100.21:9199/scyx') b.maximize_window()运行报错:
Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x015FA530>>
Traceback (most recent call last):
File "C:\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 173, in __del__
File "C:\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 149, in stop
File "C:\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 120, in send_remote_shutdown_command
ImportError: sys.meta_path is None, Python is likely shutting down
解决方案:
在下面增加quit()
from selenium import webdriver b = webdriver.Chrome() b.get('http://192.168.100.21:9199/scyx') b.maximize_window() b.quit()搞定