簡體   English   中英

如何在 python 中設置 selenium?

[英]How do I set up selenium in python?

所以我剛剛開始學習 python 並且我決定使用 selenium,但是在安裝它並從 pypi.org 復制粘貼一些非常簡單的代碼之后,我遇到了一條很長的錯誤消息。

我試圖運行的代碼如下:

from selenium import webdriver

browser = webdriver.Firefox()
browser.get('https://example.com/')

我已經在 cmd 中完成了“pip install selenium”並下載了 firefox,但問題仍然存在。

您還需要下載 firefox webdriver

from selenium import webdriver

browser = webdriver.Firefox('downloaded_driver_path')
browser.get('https://example.com/')

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM