如何解决“ ModuleNotFoundError:没有名为'selenium.webdriver.firefox'的模块”?

时间:2019-07-25 18:16:53

标签: python selenium selenium-webdriver selenium-chromedriver geckodriver

我在Mac上安装了Anaconda,并且硒已预装。但是,没有任何机会,我自己使用sudo pip3 install selenium安装了它。然后,我下载了gecokdriver(用于Mozilla Firefox)和chromedriver文件。

现在,当我尝试import selenium时,它可以正常工作。

当我尝试from selenium import webdriver时,它抛出一个错误:

>  File "<ipython-input-22-93833772b63f>", line 1, in <module>
>     from selenium import webdriver
> 
>   File
> "/Applications/anaconda3/lib/python3.7/site-packages/selenium/webdriver/__init__.py",
> line 18, in <module>
>     from .firefox.webdriver import WebDriver as Firefox  # noqa
> 
> ModuleNotFoundError: No module named 'selenium.webdriver.firefox' `

作为错误状态,文件-/ Applications / anaconda3 / lib / python3.7 / site-packages / selenium / webdriver / __ init_ _.py尝试调用from .firefox.webdriver import WebDriver as Firefox # noqa。但是我认为我的Mac上没有文件或与“ .firefox.webdriver”相关的任何东西,这就是为什么它会引发错误。

我该如何解决!!

0 个答案:

没有答案
相关问题