About This Book
Decoding the Secrets of the Web with Python is a deep dive into the world of web scraping and automation, designed for both beginners and experienced developers. The book spans six chapters, guiding readers through the fundamentals of web data extraction, HTML and CSS decoding, and automation with Selenium. With a strong emphasis on real-world applications, it provides a hands-on approach to mastering web scraping using Python, BeautifulSoup, and Requests. Whether you’re just starting out or looking to refine your skills, this book serves as a practical companion in your learning journey.
Writing this book was a labor of love—not just for coding but for the challenge of making complex concepts accessible. Web scraping was my gateway into Python, and I’ve always seen it as a puzzle-solving adventure. I wanted to share that passion, so I wrote this book in a way that speaks to both curious beginners and tech-savvy professionals. The Persian edition was my first step, and seeing it come to life as a paperback in Iran was an unforgettable milestone. Each page holds not just code, but the story of my journey into programming and automation.
After the success of the Persian edition, I knew I had to take it a step further. Now, I’m beyond excited to announce that the English version is officially available on Amazon Kindle worldwide! 🌍📚 This means that developers, students, and tech enthusiasts from around the world can now explore the power of web scraping in a structured, easy-to-follow way. It’s amazing to know that something I once wrote for a local audience has now become a global resource.
Looking back, this journey has been full of challenges, late-night edits, and moments of doubt, but also incredible growth. Writing a book isn’t just about sharing knowledge—it’s about capturing a piece of yourself on paper. If you’re someone who loves coding, problem-solving, or just wants to explore how websites work behind the scenes, I hope this book sparks curiosity and helps you on your own learning path. 🚀🐍
Table Of Content
Preface
Who is this book for?
Gather the Tools for Your Journey
Download the example code files
Navigating the Book's Format
Let's Grow Together
Introduction to the Command Line
Installing Python
Installing Python Modules and Packages
Setting Up a Virtual Environment
Installing Required Python Packages
The Python Interpreter
Visual Studio Code
Launching a Web Browser
Jupyter Notebook
Summary
Numeric Data
Strings
Lists
True و False
Variables
Naming Conventions
Multiple Assignments
Mathematical Operators
Built-in Functions
String Operators
List Operators
Input and Output
if, elif, and else Statements
Loops
Functions
Data Structures
Working with Files
Exception Handling
Summary
Steps to Building a Web Page
Deep Dive into the Secrets of Web Pages
Creating Your First Web Page
Structure and Anatomy of HTML
Basic HTML Tags
Designing and Beautifying HTML Pages
Creating Tables
Creating and Using Lists
Working with Forms
Class and ID Attributes
Summary
A Beginner's Guide to Requests
Diving into HTML with BeautifulSoup
The find_all Function
The find Function
The Parent Function
The contents Function
The children Function
CSS selectors
Element selectors
Class selectors
ID selectors
Attribute selectors
Descendant selectors
Child selectors
A Class Selector Example
An Important Note!
Summary
Writing Your First Selenium Program
Browser Navigation and Control Functions
Locating and Identifying Elements
Interacting with Elements
Working with Forms
Introduction to RegEx
A Journey into the Wonderland of AI
Using RegEx in Web Data Extraction
Summary
Index