首頁  >  文章  >  後端開發  >  為什麼我在 Raspberry Pi 3 上使用 GeckoDriver 時會收到「WebDriverException:無效參數」?

為什麼我在 Raspberry Pi 3 上使用 GeckoDriver 時會收到「WebDriverException:無效參數」?

DDD
DDD原創
2024-10-26 18:35:02411瀏覽

Why am I getting

WebDriverException:Raspberry Pi 3 上的Selenium 和GeckoDriver 中出現無效參數錯誤

當您嘗試交互發生此異常先前已被終止。該問題涉及在Raspberry Pi 3 裝置上將Selenium 與Firefox 結合使用時遇到錯誤:

selenium.common.exceptions.WebDriverException: Message: invalid argument: can't kill an exited process

要解決此問題,請確保您在無頭模式下運行Firefox(如果您的系統確實如此)沒有顯示器:

<code class="python">options = Options()
options.headless = True
driver = webdriver.Firefox(options=options)</code>

此外,請驗證您使用的是Firefox、Selenium 和Geckodriver 的相容版本。有關具體相容性要求,請參閱 Mozilla 文件:

https://firefox-source-docs.mozilla.org/testing/geckodriver/Support.html

以上是為什麼我在 Raspberry Pi 3 上使用 GeckoDriver 時會收到「WebDriverException:無效參數」?的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn