Instant Nokogiri [Instant]

This title is available as an eBook only
Instant Nokogiri [Instant]
eBook: $12.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print & eBook also available on:
Learn in an Instant - Short, Fast, Focused
Table of Contents
Sample Chapters
  • 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

Book Details

Language : English
eBook : 52 pages
Release Date : August 2013
ISBN : 178328997X
ISBN 13 : 9781783289974
Author(s) : Hunter Powers
Topics and Technologies : All Books, Instant, Web Development, Open Source, Web Development

Table of Contents

Instant Nokogiri
  • Instant Nokogiri
    • So, what is Nokogiri?
    • Installation
      • Step 1 – what do I need?
      • Step 2 – Ruby
      • Step 3 – RubyGems
      • Step 4 – Nokogiri and Bundler
      • Step 5 – verify
      • And that's it
    • Quick start – creating your first Nokogiri application
      • Step 1 – research
      • Step 2 – explore
      • Step 3 – write
      • Step 4 – extend
    • Top 13 features you need to know about
      • The css method
      • The length method
      • The each method 1
      • The each method 2
      • The content method
      • The at_css method
      • The xpath method
      • The at_xpath method
      • The to_s method
      • Spoofing browser agents
      • Caching
      • SSL
      • Mechanize
    • People and places you should get to know
      • Official sites
      • Articles and tutorials
      • Community
      • Twitter

Hunter Powers

Hunter Powers, a Full Stack Web Developer, began programming at age 6, and has been gathering steam ever since. From childhood awards (including “Most Outstanding Presentation in the Field of Engineering” from NC State University and “Superior Achievement in Computer Science” from the North Carolina Student Academy of Science) to more recent achievements at TechCrunch Disrupt 2012, he has never lost his passion for the science, languages, and dynamics of computers. Powers’ early accomplishments in the field led him to open, his first business, at the age of 13. The company has prospered through the years, developing local and national websites, producing national television advertisements, and directing the art and design for an international card and print company. With a range of products including websites, book covers, advertising, logos, national festivals, and many more, his customer base includes e-commerce companies, charities and clubs, renowned foodies, and even the weatherman.

In 2011, Powers joined a big data streaming company. His work there has been represented by projects for AOL’s TechCrunch, Engadget, The Washington Post, The New York Times, Fox’s X-Factor, Fox Sports Australia, New York Presbyterian Hospital, and The NFL, to name a few. A graduate of The University of Virginia, Powers’ interests extend beyond technology into filmmaking, photography, and writing. He was first published while in high school and has written many short as well as feature length science fiction screenplays. Powers also directs with credits for multiple commercials, web videos, and short films.

Currently residing in the Logan Circle arts district in Washington DC, Powers is working on his next book. You can find his blog at

Code Downloads

Download the code and support files for this book.

Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.

Sorry, there are currently no downloads available for this title.

Frequently bought together

Instant Nokogiri [Instant] +    Network Analysis using Wireshark Cookbook =
50% Off
the second eBook
Price for both: $32.00

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

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

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.


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 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.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software