From: "Jesús Gabriel y Galán" Date: 2012-09-06T18:35:06+09:00 Subject: Re: Parsing through downloaded html On Thu, Sep 6, 2012 at 11:30 AM, Sybren Kooistra wrote: > Thank you Ivan. > > I am familiar with nokogiri (and open-uri), but have only used it to > download online websites. I am a complete newb, so I was curious how to > start: > > 1. How to automatically open (parse) all the .htmls in a folder, one by > one? Dir['*.html'].each do |file| ... end > 2. When one of these files is opened, how to parse through it, copy > certain parts to an excel like document, and close it again? You can parse through it with Nokogiri, extract the parts you want using Nokogiri methods to seach for content inside HTML. If you want to write an excel file you will need to use an excel API (no idea), or if you can generate a CSV you can use the stdlib CVS class. Jesus.