python DrissionPage的使用,一启动 就报这个错误?

from DrissionPage import ChromiumPage

page = 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] 参数错误。
阅读 4.5k
1 个回答
✓ 已被采纳

试试指定一下路径

from DrissionPage import ChromiumPage, ChromiumOptions

co = 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讨论

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏