python DrissionPage的使用,一启动 就报这个错误?
from DrissionPage import ChromiumPagepage = ChromiumPage()
page.get('https://www.baidu.com')
Traceback (most recent call last):
File ".\test1.py", line 7, in <module>
page = ChromiumPage()
File "D:\Hostipal\myvenv\lib\site-packages\DrissionPage\chromium_page.py", line 33, in __init__
super().__init__(addr_driver_opts, tab_id, timeout)
File "D:\Hostipal\myvenv\lib\site-packages\DrissionPage\chromium_base.py", line 36, in __init__
self._connect_browser(address, tab_id)
File "D:\Hostipal\myvenv\lib\site-packages\DrissionPage\chromium_page.py", line 46, in _connect_browser
self.process = connect_browser(self._driver_options)[1]
File "D:\Hostipal\myvenv\lib\site-packages\DrissionPage\functions\browser.py", line 41, in connect_browser
debugger = _run_browser(port, chrome_path, args)
File "D:\Hostipal\myvenv\lib\site-packages\DrissionPage\functions\browser.py", line 131, in _run_browser
debugger = Popen(arguments, shell=False)
File "C:\Users\78467\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\78467\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
OSError: [WinError 87] 参数错误。
回答:
试试指定一下路径
from DrissionPage import ChromiumPage, ChromiumOptionsco = ChromiumOptions().set_pahts(browser_path=r'你电脑chrome.exe路径')
page = ChromiumPage(addr_driver_opts=co)
page.get('https://www.baidu.com')
还有可以试试升级一下
pip install DrissionPage --upgrade
我是DrissionPage的作者,有问题可以加QQ群897838127讨论
以上是 python DrissionPage的使用,一启动 就报这个错误? 的全部内容, 来源链接: utcz.com/p/938734.html