TA的每日心情 | 奋斗 2022-7-5 15:50 |
---|
签到天数: 710 天 连续签到: 1 天 [LV.9]测试副司令
|
文件为:
# coding=utf-8
from selenium import webdriver
driver = webdriver.Firefox()
driver.get("https://www.baidu.com/")
driver.find_element_by_id("kw").send_keys("Selenium2")
driver.find_element_by_id("su").click()
driver.quit()
运行的时候:
>>>
=== RESTART: C:\Users\www\AppData\Local\Programs\Python\Python36\baidu.py ===
Traceback (most recent call last):
File "C:\Users\www\AppData\Local\Programs\Python\Python36\baidu.py", line 4, in <module>
driver = webdriver.Firefox()
File "C:\Users\www\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 148, in __init__
self.service.start()
File "C:\Users\www\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\common\service.py", line 74, in start
stdout=self.log_file, stderr=self.log_file)
File "C:\Users\www\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 667, in __init__
errread, errwrite) = self._get_handles(stdin, stdout, stderr)
File "C:\Users\www\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 905, in _get_handles
p2cread = self._make_inheritable(p2cread)
File "C:\Users\www\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 955, in _make_inheritable
_winapi.DUPLICATE_SAME_ACCESS)
OSError: [WinError 6] 句柄无效。
运行文件的时候,报错 句柄无效 |
|