Skip to content

Instantly share code, notes, and snippets.

@juliends
Created October 24, 2017 08:55
Show Gist options
  • Save juliends/ba35cfb06d7f7d0c34865018d04b094f to your computer and use it in GitHub Desktop.
Save juliends/ba35cfb06d7f7d0c34865018d04b094f to your computer and use it in GitHub Desktop.
scrapper
require 'open-uri'
require 'nokogiri'
url = 'http://www.letscookfrench.com/recipes/find-recipe.aspx?aqt=chocolate'
html_file = open(url).read
html_doc = Nokogiri::HTML(html_file)
html_doc.search('.m_contenu_resultat').each do |element|
p element.search('.m_titre_resultat a').text
p element.search('.m_texte_resultat').text.strip
puts "------------------------------------------------"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment