How to select a link href using iterator?
Closed this issue · 0 comments
jianbo commented
I have a list of links to extract from a web page, but how do I select the attribute href when I use iterator? Following code always select the first link.
result = Wombat.crawl do
base_url provider_urls.url
path '/'
articles 'css=.article table.olt td.title', :iterator do
title({ css: "a" })
article_path({xpath: Nokogiri::CSS.xpath_for(".article table.olt td.title a")[0] + '/@href'})
end
end
http://stackoverflow.com/questions/30498120/ruby-wombot-select-link-url-attribute-within-iterator