![]() If you installed it using pip, try (on mac) driver = webdriver.Chrome("./venv/selenium/webdriver/chromedriver"). webdriver.Chrome() can also take a parameter for your chromedriver location.If you don't, the Selenium chromedriver can not access the Chrome binary. Make sure you also have the chrome browser installed.If the line driver = webdriver.Chrome() is throwing errors: Type "help", "copyright", "credits" or "license" for more information.Ĭreate a new webdriver (in this case, a chromedriver), and go to > from selenium import webdriverĬlose the driver and python interpreter: > driver.quit() To make sure everything is set up correctly: You now have a version-controlled VirtualEnv. If you want to run Selenium in google chrome, also do this: $: pip install chromedriver Alternatively, open Anaconda Prompt (Windows) or the Terminal (Mac), type the command conda install selenium, and agree to whatever the package manager wants to install or update (usually by pressing y to confirm your choice). Selenium comes with the FireFox driver by default. Install Selenium using pip: $: pip install selenium If you are planning to use Selenium with Node.js, you can npm install selenium-webdriveron your terminal, and if you are using Selenium with Python, you can pip3 install selenium on your terminal. ![]() You should see now see (venv) at the beginning of each bash line. Install virtualenv using: $: pip install virtualenvĬreate/enter a directory for your Selenium files: $: cd my_selenium_projectĬreate a new VirtualEnv in the directory for your Selenium files: $: virtualenv -p /usr/bin/python3.0 venvĪctivate the VirtualEnv: $: source venv/bin/active The easiest way is to use pip and VirtualEnv.
0 Comments
Leave a Reply. |