Preface Part I. Building Scrapers 1. Your First Web Scraper Connecting An Introduction to BeautifulSoup Installing BeautifulSoup Running BeautifulSoup Connecting Reliably and Handling Exceptions 2. Advanced HTML Parsing You Don't Always Need a Hammer Another Serving of BeautifulSoup findo and findallo with BeautifulSoup Other BeautifulSoup Objects Navigating Trees Regular Expressions Regular Expressions and BeautifulSoup Accessing Attributes Lambda Expressions 3. Writing Web Crawlers Traversing a Single Domain Crawling an Entire Site Collecting Data Across an Entire Site Crawling Across the Internet 4. Web Crawling Models Planning and Defining Objects Dealing with Different Website Layouts Structuring Crawlers Crawling Sites Through Search Crawling Sites Through Links Crawling Multiple Page Types Thinking About Web Crawler Models 5. Scrapy Installing Scrapy Initializing a New Spider Writing a Simple Scraper Spidering with Rules Creating Items Outputting Items The Item Pipeline Logging with Scrapy More Resources 6. St0ring Data Media Files Storing Data to CSV MySQL Installing MySQL Some Basic Commands Integrating with Python Database Techniques and Good Practice "Six Degrees" in MySQL