Automating screenshots with Selenium

One of our web sites has a help section which includes screenshots of the web site itself. Needless to say, the screenshots quickly become out-of-date when we modify the site. After manually updating the screenshots a couple times, I decided to automate the process using Selenium and Python. This post describes: Setting up Selenium in a Python virtual environment Initializing the WebDriver Interacting with the web site Taking screenshots of specific elements Set up the virtual environment We’ll install Selenium in a new Python virtual environment. Selenium also requires a driver to interface with the browser which must be installed separately. ...

21 December, 2020 · Max Smolens