Evan Martin (evan) wrote in evan_tech,
Evan Martin
evan
evan_tech

screen scraping with ruby

For various reasons I seem to often need to screen-scrape websites. I've tried Rubyful Soup but it seems to take tens of seconds to parse relatively small files. I just now tried htmltools as well and it's also incredibly slow -- 9.7 seconds to parse a 400kb file on a P4 3.8ghz machine!

The file is really straightforward, too: it's just one huge table. How hard is this to parse quickly? Firefox seems to have no trouble with it...

So my question for you: what should I be using instead? (I'm happy to switch languages -- gaal/brad, which Perl HTML parsing library is the most pleasant? Preferably something that doesn't use SAX or DOM APIs...)
Tags: grumpy, ruby
Subscribe
  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 19 comments