Instant Nokogiri
- Length: 52 pages
- Edition: 1
- Language: English
- Publisher: Packt Publishing
- Publication Date: 2013-08-26
- ISBN-10: 178328997X
- ISBN-13: 9781783289974
- Sales Rank: #7269704 (See Top 100 Books)
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.
Table of Contents
Chapter 1. So, what is Nokogiri?
Chapter 2. Installation
Chapter 3. Quick start – creating your frst Nokogiri application
Chapter 4. Top 13 features you need to know about
Chapter 5. People and places you should get to know