Simple scrapping with ruby

Simple scrapping using Nokogiri

require 'open-uri'  
require 'nokogiri'  
doc = Nokogiri::HTML(open(""))  

Nokogiri + RestClient helps you out if you want to handle redirects

require 'restclient'  
require 'nokogiri'

page = Nokogiri::HTML(RestClient.get(""))  

Using Mechanize

first of all, install mechanize

gem install mechanize  
require 'mechanize'

mechanize =

page = mechanize.get('')

puts page.title  

More: In progress

Victor Velazquez

Coder, Musician, Startups, Passionate Dancer & Life Lover. Director of Engineering at MagmaLabs, Co-founder of Web Dev Talks, Co-founder of Voltaire, Co-founder of Paqkit, Ex-co-founder of Zaznova.

Subscribe to The zazvick's blog

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!