Using Selenium for advanced interaction
Sometimes, nothing short of the real thing will work. Selenium is a project to use to achieve automation in web browsers. It's conceived as a way of automatic testing, but it also can be used to automate interactions with a site.
Selenium can control Safari, Chrome, Firefox, Internet Explorer, or Microsoft Edge, though it requires installing a specific driver for each case. We'll use Chrome.
Getting ready
We need to install the right driver for Chrome, called chromedriver
. It is available here: https://sites.google.com/a/chromium.org/chromedriver/. It is available for most platforms. It also requires that you have Chrome installed: https://www.google.com/chrome/.
Add the selenium
module to requirements.txt
and install it:
$ echo "selenium==3.141.0" >> requirements.txt
$ pip install -r requirements.txt
How to do it...
- Import Selenium, start a browser and load the form page. A...