Selenium With Python
Selenium automates browsers. That's it! What you do with that power is entirely up to you.
See the official Selenium site for details and documentation.
How to install Selenium¶
pip install selenium
Web Driver
You will also need to install a web-driver to use Selenium. A common choice is ChromeDriver - the one we use. See the official Selenium Python documentation for details and alternatives.
How to import Selenium¶
Generally, we don't import Selenium as a whole, but rather the modules we need. Often, this will simply be the webdriver
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
Keys
, or
from selenium.webdriver.common.by import By
to select elements By their HTML properties.
Selenium Playground¶
Check out seleniumplayground.practiceprobs.com - our sample site where you can scrape data, click buttons, and submit forms without fear of violating our terms of service.