Web · Ebook
Selenium: Browser Automation for Testing and Scraping
by Shriira Press
A comprehensive, self-contained guide to Selenium — the framework that drives a real web browser through code. Where requests fetches static HTML and Beautiful Soup parses it, Selenium does what neither can: it launches an actual Chrome, Firefox, or Edge, navigates pages, runs their JavaScript, clicks buttons, fills forms, and sees the page exactly as a human would. That makes it the tool for two big jobs — automated web testing (its original purpose) and scraping JavaScript-rendered pages (the dynamic content the Scrapy and Beautiful Soup books point here for). This book teaches it end to end — WebDriver, locating and interacting with elements, the all-important waits, advanced actions, frames/windows/alerts, headless configuration, the Page Object Model for testing, Grid and scaling, and the modern ecosystem — blending intuition, the concepts behind the framework, and runnable code.
Contents
- 1Preface
- 2Chapter 1 — What Is Selenium?
- 3Chapter 2 — How Browsers and WebDriver Work
- 4Chapter 3 — Getting Started: Your First Script
- 5Chapter 4 — Locating Elements
- 6Chapter 5 — Interacting with Elements
- 7Chapter 6 — Waiting: The Heart of Reliable Automation
- 8Chapter 7 — Advanced Interactions and JavaScript
- 9Chapter 8 — Frames, Windows, Tabs, and Alerts
- 10Chapter 9 — Dynamic Content and Scraping with Selenium
- 11Chapter 10 — Headless, Options, and Browser Configuration
- 12Chapter 11 — Web Testing with Selenium
- 13Chapter 12 — Scaling, Robustness, and the Grid
- 14Chapter 13 — In Practice, the Ecosystem, and the Profession
- 15Appendix A — Glossary and Quick Reference
- 16Appendix B — Further Reading and Resources
