WebDriverException: Invalid Argument in GeckoDriver with Selenium and Python on Raspberry Pi 3
嘗試使用以下方式與Web 瀏覽器此錯誤無頭Raspberry Pi 3 系統上的GeckoDriver、Selenium 和Python。此錯誤訊息表示嘗試終止已退出的進程失敗。
根本原因
此處的主要問題是 GeckoDriver 未正確配置為無頭模式。
解決方案
要解決此問題,請透過以下變更來確保啟用無頭模式:
<code class="python">from selenium import webdriver from selenium.webdriver.firefox.options import Options options = Options() options.headless = True # Enable headless mode driver = webdriver.Firefox(options=options)</code>
相容性注意事項
此外,請驗證您是否正在執行相容版本的Firefox、Selenium 和GeckoDriver。支援的版本組合請參考官方文件:https://firefox-source-docs.mozilla.org/testing/geckodriver/Support.html
以上是根據提供的文本,以下是問題格式中的一些標題選項: 選項1(聚焦問題): * 為什麼我在使用 Gec 時收到“WebDriverException:無效參數”的詳細內容。更多資訊請關注PHP中文網其他相關文章!