Created
November 5, 2015 10:56
-
-
Save dabonka/59c67c4e53ffdc4617fe to your computer and use it in GitHub Desktop.
seeds.rb - наполнение базы пока закомментил, не могу пофиксить правильность границ для парсинга.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "nokogiri" | |
require "open-uri" | |
page = Nokogiri::HTML(open("http://lingvotutor.ru/1500-samyx-upotreblyaemyx-slov-k-toefl")) | |
word_list = [] | |
page.search("tr")[0].each do |row| | |
original = row.css('th')[0].content | |
translated = row.css('th')[0].content | |
word_list << Hash[original, translated] | |
end | |
# word_list.each do |original, translated| | |
# 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