how to install selenium

时间秒杀一切 提交于 2020-06-28 06:36:45

问题


I am using python 3.5.2, when am tryng to import the selenium it is throwing an error

No module named selenium

below is my code:

from selenium import webdriver

回答1:


You should install the selenium package first.

pip install selenium



回答2:


I installed selenium through

pip install selenium

like yan said, but I still received the same error. The problem in my case was that selenium was installed on a different drive than my project was on (i.e. project was on D:, selenium was on C:). Moving both to the C: drive fixed it for me.




回答3:


Step 1: Install Python bindings for Selenium

pip install selenium

Step 2: Install the browser drivers

Selenium requires a driver to interface with the chosen browser.

Firefox, for example, requires geckodriver, which needs to be installed.

  1. Get the executable from here (just download one from the last release)
  2. Move the executable to your PATH, e. g. ubuntu, place it in /usr/bin or /usr/local/bin.

Note: Other supported browsers will have their own drivers available more info here



来源:https://stackoverflow.com/questions/46999613/how-to-install-selenium

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!