在以下情况中忽略了异常:<function Service .__ del__ at 0x02FE52B8> selenium python

我买了一台新电脑,我现在尝试使用铬中的硒,但我得到一个奇怪的会话例外 .

忽略异常:Traceback(最近一次调用最后一次):文件“C:\ Program Files(x86)\ Python37-32 \ lib \ site-packages \ selenium \ webdriver \ common \ service.py”,第163行,在del中文件“C:\ Program Files(x86)\ Python37-32 \ lib \ site-packages \ selenium \ webdriver \ common \ service.py”,第139行,在停止文件“C:\ Program Files(x86)\ Python37- 32 \ lib \ site-packages \ selenium \ webdriver \ common \ service.py“,第110行,在send_remote_shutdown_command中导入错误:sys.meta_path为None,Python可能正在关闭

我的代码:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

driver = webdriver.Chrome(executable_path=r"D:\Program Files\ChromeDriver\chromedriver.exe")


keyword = "google"
max_pages = 3

for page in range(1, max_pages):
	page_num = page * 10
	url = "https://www.google.co.il/search?q=%s&start=%i" % (keyword,page_num)

driver.close()

回答(0)