Created
November 5, 2015 12:46
-
-
Save dabonka/ee78babc4bb205bd4b8c to your computer and use it in GitHub Desktop.
ошибка: NoMethodError: undefined method `each' for nil:NilClass
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("table.tablepress tablepress-id-579")[0].each do |row| | |
original = row.css('th.column-1')[0].text | |
translated = row.css('th.column-3')[0].text | |
word_list << Hash[original, translated] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment