Answer the question
In order to leave comments, you need to log in
Why is Nokogiri returning an empty array?
Good health, dear ones!
I'm trying to parse the hh.ru page, but why it doesn't work, please tell me what I'm doing wrong:
require 'nokogiri'
require 'rubygems'
require 'open-uri'
leaf = 0
count = Array.new
until leaf > 2
url = "https://rostov.hh.ru/search/vacancy?L_is_autosearch=false&area=113&clusters=true&enable_snippets=true&order_by=publication_time&schedule=remote&page=#{leaf}"
page = Nokogiri::HTML(open(url))
element = page.css('div').select { |e| e['class'] == 'vacancy-serp-item' }
p element
leaf += 1
count << links
end
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question