Python Web Scraping Cookbook: Over 90 proven recipes to get you scraping with Python, micro services, Docker and AWS

Michael Heydt

買這商品的人也買了...

相關主題

商品描述

Untangle your web scraping complexities and access web data with ease using Python scripts

Key Features

  • Hands-on recipes for advancing your web scraping skills to expert level.
  • One-Stop Solution Guide to address complex and challenging web scraping tasks using Python.
  • Understand the web page structure and collect meaningful data from the website with ease

Book Description

Python Web Scraping Cookbook is a solution-focused book that will teach you techniques to develop high-performance scrapers and deal with crawlers, sitemaps, forms automation,

Ajax-based sites, caches, and more.You'll explore a number of real-world scenarios where every part of the development/product life cycle will be fully covered. You will not only develop the skills to design and develop reliable, performance data flows, but also deploy your codebase to an AWS. If you are involved in software engineering, product development, or data mining (or are interested in building data-driven products), you will find this book useful as each recipe has a clear purpose and objective.

Right from extracting data from the websites to writing a sophisticated web crawler, the book's independent recipes will be a godsend on the job. This book covers Python libraries, requests, and BeautifulSoup. You will learn about crawling, web spidering, working with AJAX websites, paginated items, and more. You will also learn to tackle problems such as 403 errors, working with proxy, scraping images, LXML, and more.

By the end of this book, you will be able to scrape websites more efficiently and to be able to deploy and operate your scraper in the cloud.

What you will learn

  • Use a wide variety of tools to scrape any website and data-including BeautifulSoup, Scrapy, Selenium, and many more
  • Master expression languages such as XPath, CSS, and regular expressions to extract web data
  • Deal with scraping traps such as hidden form fields, throttling, pagination, and different status codes
  • Build robust scraping pipelines with SQS and RabbitMQ
  • Scrape assets such as images media and know what to do when Scraper fails to run
  • Explore ETL techniques of build a customized crawler, parser, and convert structured and unstructured data from websites
  • Deploy and run your scraper-as-aservice in AWS Elastic Container Service

Who This Book Is For

This book is ideal for Python programmers, web administrators, security professionals or someone who wants to perform web analytics would find this book relevant and useful. Familiarity with Python and basic understanding of web scraping would be useful to take full advantage of this book.

Table of Contents

  1. Getting started with Scraping
  2. Data acquisition and extraction
  3. Processing Data
  4. Working with images, audio and other assets
  5. Scraping - Code of Conduct
  6. Scraping Challenges and Solutions
  7. Text Wrangling and Analysis
  8. Searching, mining and visualizing data
  9. Working with an API and Providing a Data API
  10. Creating scraper microservices with Docker
  11. A complete real world example

商品描述(中文翻譯)

解開網頁爬蟲的複雜性,並使用Python腳本輕鬆訪問網絡數據

主要特點

- 實踐提升網絡爬蟲技能至專家級的實用食譜。
- 一站式解決方案指南,以Python應對複雜且具有挑戰性的網絡爬蟲任務。
- 瞭解網頁結構,輕鬆從網站收集有意義的數據。

書籍描述

《Python網絡爬蟲食譜》是一本以解決問題為導向的書籍,將教授您開發高性能爬蟲並處理爬蟲器、站點地圖、表單自動化、基於Ajax的網站、緩存等技術。您將探索多個現實世界的場景,其中涵蓋了開發/產品生命周期的各個部分。您不僅將學習設計和開發可靠、高性能的數據流程的技能,還將部署您的代碼庫到AWS。如果您從事軟件工程、產品開發或數據挖掘(或有興趣構建數據驅動的產品),您會發現本書非常有用,因為每個食譜都有明確的目的和目標。

從從網站提取數據到編寫複雜的網絡爬蟲,本書獨立的食譜將成為您工作中的救星。本書涵蓋了Python庫、requests和BeautifulSoup。您將學習爬行、網絡蜘蛛、與AJAX網站一起工作、分頁項目等等。您還將學習解決問題,如403錯誤、使用代理、爬取圖片、LXML等等。

通過閱讀本書,您將能夠更高效地爬取網站,並能夠在雲端部署和運行您的爬蟲。

您將學到什麼

- 使用各種工具(包括BeautifulSoup、Scrapy、Selenium等)來爬取任何網站和數據。
- 掌握XPath、CSS和正則表達式等表達語言,以提取網絡數據。
- 處理隱藏表單字段、限流、分頁和不同的狀態碼等爬取陷阱。
- 使用SQS和RabbitMQ構建強大的爬取流水線。
- 爬取圖片、媒體等資源,並在爬蟲運行失敗時採取相應措施。
- 探索ETL技術,構建定制的爬蟲、解析器,並從網站中轉換結構化和非結構化數據。
- 在AWS Elastic Container Service中部署和運行您的爬蟲作為服務。

本書適合對象

本書適合Python程序員、網絡管理員、安全專業人員或希望進行網絡分析的人士。熟悉Python和基本的網絡爬蟲理解將有助於充分利用本書。

目錄

1. 開始爬取
2. 數據獲取和提取
3. 數據處理
4. 處理圖片、音頻和其他資源
5. 爬取 - 行為準則
6. 爬取挑戰和解決方案
7. 文本整理和分析
8. 搜索、挖掘和可視化數據
9. 使用API並提供數據API
10. 使用Docker創建爬蟲微服務
11. 完整的實際案例