Skip to content

Instantly share code, notes, and snippets.

@dabonka
Created November 5, 2015 14:36
Show Gist options
  • Save dabonka/70cdf93aa0ca43469a62 to your computer and use it in GitHub Desktop.
Save dabonka/70cdf93aa0ca43469a62 to your computer and use it in GitHub Desktop.
require "nokogiri"
require "open-uri"
page = Nokogiri::HTML(open("http://www.lesson1.ru/vocabulary/lexicographer/weather.html"))
page.search("tr")[2].each do |row|
original = row.css("td")[1].text
translated = row.css("td")[0].text
Card.create( original_text: original, translated_text: translated )
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment