Skip to content

Instantly share code, notes, and snippets.

@Papillard
Created April 14, 2014 14:41
Show Gist options
  • Save Papillard/10654300 to your computer and use it in GitHub Desktop.
Save Papillard/10654300 to your computer and use it in GitHub Desktop.
require 'open-uri'
require 'nokogiri'
html_file = open("http://www.leboncoin.fr/annonces/offres/ile_de_france/?q=treteau")
html_doc = Nokogiri::HTML(html_file)
html_doc.search('.lbc').each do |element|
puts element.search('.title').inner_text
puts element.search('.category').inner_text
puts element.search('.price').inner_text
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment