Skip to content

Instantly share code, notes, and snippets.

@drymar
Created December 17, 2016 20:40
Show Gist options
  • Save drymar/f69b593e65cbdf488acdfd06ed944e42 to your computer and use it in GitHub Desktop.
Save drymar/f69b593e65cbdf488acdfd06ed944e42 to your computer and use it in GitHub Desktop.
require 'open-uri'
require 'nokogiri'
def words
uri = 'http://www.languagedaily.com/learn-german/vocabulary/common-german-words'
html = open(uri)
doc = Nokogiri::HTML(html)
germans = doc.css('td.bigLetter')
germans.each do |german|
puts "German is: #{german.text}"
puts "English is: #{german.next_element.text}"
end
end
words
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment