Go Web Scraping Quick Start Guide: Implement the power of Go to scrape and crawl data from the web
暫譯: Go 網頁爬蟲快速入門指南:運用 Go 的力量從網路上擷取和爬取資料
Vincent Smith
- 出版商: Packt Publishing
- 出版日期: 2019-01-31
- 售價: $1,260
- 貴賓價: 9.5 折 $1,197
- 語言: 英文
- 頁數: 132
- 裝訂: Paperback
- ISBN: 1789615704
- ISBN-13: 9781789615708
-
相關分類:
Go 程式語言、程式語言、Web-crawler 網路爬蟲
海外代購書籍(需單獨結帳)
商品描述
Learn how some Go-specific language features help to simplify building web scrapers along with common pitfalls and best practices regarding web scraping.
Key Features
- Use Go libraries like Goquery and Colly to scrape the web
- Common pitfalls and best practices to effectively scrape and crawl
- Learn how to scrape using the Go concurrency model
Book Description
Web scraping is the process of extracting information from the web using various tools that perform scraping and crawling. Go is emerging as the language of choice for scraping using a variety of libraries. This book will quickly explain to you, how to scrape data data from various websites using Go libraries such as Colly and Goquery.
The book starts with an introduction to the use cases of building a web scraper and the main features of the Go programming language, along with setting up a Go environment. It then moves on to HTTP requests and responses and talks about how Go handles them. You will also learn about a number of basic web scraping etiquettes.
You will be taught how to navigate through a website, using a breadth-first and then a depth-first search, as well as find and follow links. You will get to know about the ways to track history in order to avoid loops and to protect your web scraper using proxies.
Finally the book will cover the Go concurrency model, and how to run scrapers in parallel, along with large-scale distributed web scraping.
What you will learn
- Implement Cache-Control to avoid unnecessary network calls
- Coordinate concurrent scrapers
- Design a custom, larger-scale scraping system
- Scrape basic HTML pages with Colly and JavaScript pages with chromedp
- Discover how to search using the "strings" and "regexp" packages
- Set up a Go development environment
- Retrieve information from an HTML document
- Protect your web scraper from being blocked by using proxies
- Control web browsers to scrape JavaScript sites
Who this book is for
Data scientists, and web developers with a basic knowledge of Golang wanting to collect web data and analyze them for effective reporting and visualization.
Table of Contents
- Introducing Web Scraping and Go
- The Request/Response Cycle
- Web Scraping Etiquette
- Parsing HTML
- Web Scraping Navigation
- Protecting Your Web Scraper
- Scraping with Concurrency
- Scraping at 100x
商品描述(中文翻譯)
了解一些 Go 特有的語言特性如何簡化構建網頁爬蟲,以及有關網頁爬蟲的常見陷阱和最佳實踐。
主要特點
- 使用 Go 函式庫如 Goquery 和 Colly 來抓取網頁
- 有效抓取和爬行的常見陷阱和最佳實踐
- 學習如何使用 Go 的併發模型進行抓取
書籍描述
網頁爬蟲是從網路上提取資訊的過程,使用各種執行抓取和爬行的工具。Go 正逐漸成為使用各種函式庫進行抓取的首選語言。本書將快速向您解釋如何使用 Go 函式庫如 Colly 和 Goquery 從各種網站抓取數據。
本書首先介紹了構建網頁爬蟲的使用案例和 Go 程式語言的主要特性,以及如何設置 Go 環境。接著將討論 HTTP 請求和響應,以及 Go 如何處理它們。您還將學習一些基本的網頁抓取禮儀。
您將學會如何通過廣度優先和深度優先搜索來導航網站,以及如何查找和跟隨鏈接。您將了解如何追蹤歷史以避免循環,並使用代理來保護您的網頁爬蟲。
最後,本書將涵蓋 Go 的併發模型,以及如何並行運行爬蟲,並進行大規模的分佈式網頁抓取。
您將學到的內容
- 實現 Cache-Control 以避免不必要的網路調用
- 協調併發爬蟲
- 設計自定義的大規模抓取系統
- 使用 Colly 抓取基本 HTML 頁面,使用 chromedp 抓取 JavaScript 頁面
- 發現如何使用 'strings' 和 'regexp' 套件進行搜索
- 設置 Go 開發環境
- 從 HTML 文檔中檢索資訊
- 使用代理保護您的網頁爬蟲不被封鎖
- 控制網頁瀏覽器以抓取 JavaScript 網站
本書適合誰
數據科學家和具有基本 Golang 知識的網頁開發人員,希望收集網頁數據並進行有效的報告和可視化分析。
目錄
- 介紹網頁抓取和 Go
- 請求/響應循環
- 網頁抓取禮儀
- 解析 HTML
- 網頁抓取導航
- 保護您的網頁爬蟲
- 使用併發進行抓取
- 以 100 倍速度抓取