Instant Nokogiri

Hunter Powers

  • 出版商: Packt Publishing
  • 出版日期: 2013-08-10
  • 售價: $1,170
  • 貴賓價: 9.5$1,112
  • 語言: 英文
  • 頁數: 52
  • 裝訂: Paperback
  • ISBN: 178328997X
  • ISBN-13: 9781783289974
  • 海外代購書籍(需單獨結帳)

相關主題

商品描述

Learning data scraping and parsing in Ruby using the Nokogiri gem

Overview

  • Learn something new in an Instant! A short, fast, focused guide delivering immediate results
  • Master Nokogiri with the use of clear, step-by-step instructions and real world examples
  • Learn how to identify sources, parse documents, and extract information from them
  • Use the interactive Ruby shell and the features of Nokogiri to test and refine your theories in real-time

In Detail

A wealth of information sits waiting on the Internet. Instant Nokogiri helps you access this information today with Nokogiri, a slick and fast HTML and XML parsing engine. Bundled in an easy-to-use Ruby gem, Nokogiri empowers you to combine disparate data sources and gain an unprecedented insight into your Ruby applications.

"Instant Nokogiri" is a hands-on guide to extracting information from the sources available on the Internet, sources that are not traditionally accessible to developers. You will learn the secrets of identifying content, extracting just the right parts, and incorporating the new data in your Ruby applications.

"Instant Nokogiri" provides step-by-step instructions on how to incorporate the power of the Nokogiri gem and data parsing into your Ruby projects. You will learn all the basics of designing a project around data parsing, exploring disparate data sources, and refining strategies and theories. You will also combine your thoughts in a real-world, real-data sample application. This book will examine common Nokogiri and Ruby methods useful in scraping and parsing complete with practical code samples. You will also learn the secrets behind effective caching, rate limiting, and masking your identity. Instant Nokogiri will teach you how to get targeted data out of HTML and into Ruby, as well as tons of tips, tricks, code snippets, and expert advice.

What you will learn from this book

  • Set up a development environment for Nokogiri
  • Know when to use a parsing engine
  • Identify ideal sources from which to extract content and devise optimal strategies for selecting content
  • Use CSS and XPath selectors to target content
  • Test your theories in an interactive Ruby shell
  • Work with live web data
  • Avoid detection and be a good netizen
  • Incorporate your finished snippets in a full Sinatra application

Approach

Get to grips with a new technology, understand what it is and what it can do for you, and then get to work with the most important features and tasks. A concise, illustrated guide to extracting information available on the Internet using Nokogiri.

Who this book is written for

"Instant Nokogiri" is the perfect choice for the aspiring Ruby developer looking to incorporate screen scraping and parsing technology in their applications. Beginner level Ruby, basic HTML, and CSS experience is suggested.

商品描述(中文翻譯)

學習使用 Nokogiri gem 在 Ruby 中進行資料擷取和解析

概述
- 立即學習新知!一本短小、快速、專注的指南,提供即時結果
- 通過清晰的逐步指導和實際範例掌握 Nokogiri
- 學習如何識別來源、解析文件並從中提取資訊
- 使用互動式 Ruby shell 和 Nokogiri 的功能即時測試和完善你的理論

詳細內容
互聯網上有大量資訊等待著你去探索。Instant Nokogiri 幫助你今天就能使用 Nokogiri 這個流暢且快速的 HTML 和 XML 解析引擎來訪問這些資訊。Nokogiri 被打包成一個易於使用的 Ruby gem,使你能夠結合不同的資料來源,並對你的 Ruby 應用程式獲得前所未有的洞察。

《Instant Nokogiri》是一本實用指南,教你如何從互聯網上提取資訊,這些來源對開發者來說並不傳統可及。你將學習識別內容、提取正確部分的秘密,並將新數據整合到你的 Ruby 應用程式中。

《Instant Nokogiri》提供逐步指導,教你如何將 Nokogiri gem 的強大功能和資料解析納入你的 Ruby 專案。你將學習設計圍繞資料解析的專案的基本知識,探索不同的資料來源,並完善策略和理論。你還將在一個真實的、實際數據的範例應用中結合你的想法。本書將探討在擷取和解析中常用的 Nokogiri 和 Ruby 方法,並附上實用的程式碼範例。你還將學習有效快取、速率限制和隱藏身份的秘密。Instant Nokogiri 將教你如何從 HTML 中提取目標數據並轉入 Ruby,還有大量的提示、技巧、程式碼片段和專家建議。

你將從本書中學到的內容
- 設置 Nokogiri 的開發環境
- 知道何時使用解析引擎
- 識別理想的內容提取來源並制定最佳內容選擇策略
- 使用 CSS 和 XPath 選擇器來定位內容
- 在互動式 Ruby shell 中測試你的理論
- 使用實時網頁數據
- 避免被檢測並成為一個良好的網路公民
- 將你的完成片段整合到完整的 Sinatra 應用中

方法
掌握一項新技術,了解它是什麼以及它能為你做什麼,然後開始使用最重要的功能和任務。一本簡明的插圖指南,教你如何使用 Nokogiri 擷取互聯網上可用的資訊。

本書的讀者對象
《Instant Nokogiri》是希望在其應用程式中整合螢幕擷取和解析技術的有志 Ruby 開發者的完美選擇。建議具備初級 Ruby、基本 HTML 和 CSS 經驗。