Skip to content

Instantly share code, notes, and snippets.

@dabonka
Created November 5, 2015 12:46
Show Gist options
  • Save dabonka/ee78babc4bb205bd4b8c to your computer and use it in GitHub Desktop.
Save dabonka/ee78babc4bb205bd4b8c to your computer and use it in GitHub Desktop.
ошибка: NoMethodError: undefined method `each' for nil:NilClass
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