簡體   English   中英

為什么我不能在硒中使用PhantomJ

[英]why I can't use the PhantomJs in Selenium

sudo apt-get install selenium
sudo apt-get install phantomjs

我在ubuntu 16.04下安裝了selenium和phantomjs。 但當

從硒導入webdriver

瀏覽器= webdrive.PhantomJs()

Python解釋器給出錯誤消息msg, AttributeError:'module'對象沒有屬性'PhantomJs'。 我不知道出了什么問題。 任何人都可以提一些建議。 我將非常感謝。

Ubuntu將自動為python2安裝selenium,您應該使用此命令為py3安裝phantomjs

sudo pip3 install -U硒

並確保在運行腳本時指定Python解釋器版本3

暫無
暫無

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

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