我试图保持自动Chrome窗口打开,但关闭时出现以下错误:
Traceback (most recent call last):
File "C:\Users\Duma\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 841, in __del__
self._internal_poll(_deadstate=_maxsize)
File "C:\Users\Duma\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 1193, in _internal_poll
if _WaitForSingleObject(self._handle, 0) == _WAIT_OBJECT_0:
OSError: [WinError 6] The handle is invalid
使用
硒
还有我的
蟒蛇脚本
如下所示:
login_url='https://www.life4laptop.com/index.php?route=account/login'
url='https://www.life4laptop.com/index.php?route=product/search&search=samsung'
list=[]
driver=webdriver.Chrome(crm_path, chrome_options=options)
driver.get(login_url)
elem = driver.find_element_by_id("input-email")
elem.clear()
elem.send_keys(x['life4laptop']['username'])
elem = driver.find_element_by_id("input-password")
elem.clear()
elem.send_keys(x['life4laptop']['password'])
elem = driver.find_element_by_xpath("//form/input[@type='submit']")
elem.click()
driver.get(url)
driver2=webdriver.Chrome(crm_path, chrome_options=options)
driver2.get(login_url)
elem = driver2.find_element_by_id("input-email")
elem.clear()
elem.send_keys(x['life4laptop']['username'])
elem = driver2.find_element_by_id("input-password")
elem.clear()
elem.send_keys(x['life4laptop']['password'])
elem = driver2.find_element_by_xpath("//form/input[@type='submit']")
elem.click()
driver2.get(url)
#driver.close()
#driver.quit()
任何线索
为什么
和
如何让它工作
?