Chapter 10
Automating the Web
IN THIS CHAPTER
Looking at web browser animation
Finding controls on web forms
Filling text boxes and submitting forms
Automatically filling forms from JSON data files
This chapter is all about automating web browsers. You’ll learn techniques to open a web page, find and fill text boxes, and submit the form data, exactly as you would do yourself using a mouse and keyboard. In this chapter, you make Python do all that for you.
Automating Web Browsers
If you’re looking for a way to automate opening a web page and filling one or more text boxes with known information, selenium is your best bet. Two key modules that you can import into your Python scripts are named selenium and webdriver-manager. They aren’t part of the Python standard library, so when you plan to use them in a script, make sure to create and activate your virtual environment. Then enter the following command at the Terminal:
pip install selenium webdriver-manager
The selenium module provides the ability to automatically control the browser and interact with controls on a web page. The ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access