rubyweb-crawlerhttpartyopen-uri

Fastest Net::HTTP/Net::HTTPS wrapper for Ruby


What is the fastest way to download a webpage for parsing in Ruby? I've tried using open-uri and HTTParty both seem to take roughly about 25 seconds to download simple webpages (I've tried multiple sites).

I'm passing the sites to Nokogiri but the latency takes place prior to passing any parameters to Nokogiri.


Solution

  • i prefer to use gem 'http' (https://github.com/httprb/http). It is fast, clean api.

    Also you can take a look on the http clients comparison table: https://github.com/httprb/http#another-ruby-http-library-why-should-i-care