Instant PHP Web Scraping (即時 PHP 網頁擷取)

Jacob Ward

  • 出版商: Packt Publishing
  • 出版日期: 2013-07-20
  • 售價: $1,110
  • 貴賓價: 9.5$1,055
  • 語言: 英文
  • 頁數: 60
  • 裝訂: Paperback
  • ISBN: 1782164766
  • ISBN-13: 9781782164760
  • 相關分類: PHPWeb-crawler 網路爬蟲
  • 海外代購書籍(需單獨結帳)

相關主題

商品描述

Get up and running with the basic techniques of web scraping using PHP

Overview

  • Learn something new in an Instant! A short, fast, focused guide delivering immediate results
  • Build a re-usable scraping class to expand on for future projects
  • Scrape, parse, and save data from any website with ease
  • Build a solid foundation for future web scraping topics

In Detail

With the proliferation of the web, there has never been a larger body of data freely available for common use. Harvesting and processing this data can be a time consuming task if done manually. However, web scraping can provide the tools and framework to accomplish this with the click of a button. It's no wonder, then, that web scraping is a desirable weapon in any programmer's arsenal.

Instant Web Scraping With PHP How-to uses practical examples and step-by-step instructions to guide you through the basic techniques required for web scraping with PHP. This will provide the knowledge and foundation upon which to build web scraping applications for a wide variety of situations such as data monitoring, research, data integration relevant to today's online data-driven economy.

On setting up a suitable PHP development environment, you will quickly move to building web scraping applications. Beginning with a simple task of retrieving a single web page, you will then gradually build on this by learning various techniques for identifying specific data, crawling through numerous web pages to retrieve large volumes of data, and processing then saving it for future use. You will learn how to submit login forms for accessing password protected areas, along with downloading images, documents, and emails. Learning to schedule the execution of scrapers achieves the goal of complete automation, and the final introduction of basic object-oriented programming (OOP) in the development of a scraping class provides the template for future projects.

Armed with the skills learned in the book, you will be set to embark on a wide variety of web scraping projects.

What you will learn from this book

  • Scrape and parse data from web pages using a number of different techniques
  • Create custom scraping functions
  • Download and save images and documents
  • Retrieve and scrape data from emails
  • Save scraped data into a MySQL database
  • Submit login and file upload forms
  • Use regular expressions for pattern matching
  • Process and validate scraped data
  • Crawl and scrape multiple pages of a website

Approach

Filled with practical, step-by-step instructions and clear explanations for the most important and useful tasks. Short, concise recipes to learn a variety of useful web scraping techniques using PHP.

Who this book is written for

This book is aimed at those new to web scraping, with little or no previous programming experience. Basic knowledge of HTML and the Web is useful, but not necessary.

商品描述(中文翻譯)

使用PHP快速上手並運用基本的網頁爬蟲技術。

概述:
- 立即學習!短小、快速、專注的指南,立即獲得成果。
- 建立可重複使用的爬蟲類別,以供未來專案擴展使用。
- 輕鬆地從任何網站上爬取、解析和儲存資料。
- 為未來的網頁爬蟲主題打下堅實基礎。

詳細內容:
隨著網路的普及,可供共同使用的資料量空前地龐大。如果手動處理這些資料,將是一項耗時的任務。然而,網頁爬蟲可以提供工具和框架,只需點擊一下即可完成這項任務。因此,網頁爬蟲成為任何程式設計師必備的武器,並不足為奇。

《PHP網頁爬蟲實戰》使用實例和逐步指導的方式,引導您掌握使用PHP進行網頁爬蟲所需的基本技術。這將為各種情況下的網頁爬蟲應用,如資料監控、研究和與當今線上資料驅動經濟相關的資料整合,提供知識和基礎。

在建立適合的PHP開發環境後,您將迅速開始建立網頁爬蟲應用程式。從擷取單個網頁的簡單任務開始,逐步學習識別特定資料的各種技術,通過爬取大量網頁以擷取資料,並將其處理和儲存供未來使用。您將學習如何提交登錄表單以訪問受密碼保護的區域,以及下載圖片、文件和電子郵件。學習安排爬蟲的執行,實現完全自動化的目標,並在開發爬蟲類別時引入基本的物件導向程式設計(OOP),為未來的專案提供模板。

憑藉本書所學的技能,您將能夠開展各種網頁爬蟲專案。

本書的學習重點:
- 使用多種不同技術從網頁上擷取和解析資料。
- 創建自定義的爬蟲函式。
- 下載和儲存圖片和文件。
- 擷取和解析電子郵件中的資料。
- 將擷取的資料儲存到MySQL資料庫中。
- 提交登錄和檔案上傳表單。
- 使用正則表達式進行模式匹配。
- 處理和驗證擷取的資料。
- 爬取和擷取網站的多個頁面。

方法:
本書提供實用、逐步的指導和清晰的解釋,介紹最重要和最有用的任務。短小精煉的食譜,學習使用PHP進行各種有用的網頁爬蟲技術。

本書適合對網頁爬蟲新手,並且沒有或只有很少程式設計經驗的讀者。對HTML和網頁的基本知識有所幫助,但不是必需的。