Selenium: Browser Automation for Testing and Scraping cover

Web · Ebook

Selenium: Browser Automation for Testing and Scraping

by Shriira Press

4.6(358)88 pagesPublished 2026

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

  1. 1Preface
  2. 2Chapter 1 — What Is Selenium?
  3. 3Chapter 2 — How Browsers and WebDriver Work
  4. 4Chapter 3 — Getting Started: Your First Script
  5. 5Chapter 4 — Locating Elements
  6. 6Chapter 5 — Interacting with Elements
  7. 7Chapter 6 — Waiting: The Heart of Reliable Automation
  8. 8Chapter 7 — Advanced Interactions and JavaScript
  9. 9Chapter 8 — Frames, Windows, Tabs, and Alerts
  10. 10Chapter 9 — Dynamic Content and Scraping with Selenium
  11. 11Chapter 10 — Headless, Options, and Browser Configuration
  12. 12Chapter 11 — Web Testing with Selenium
  13. 13Chapter 12 — Scaling, Robustness, and the Grid
  14. 14Chapter 13 — In Practice, the Ecosystem, and the Profession
  15. 15Appendix A — Glossary and Quick Reference
  16. 16Appendix B — Further Reading and Resources