ruby - Nokogiri Scraping -
ruby - Nokogiri Scraping -
i'd scrap title of each video , links.
doc = nokogiri::html(open('http://www.stream2u.me/')) doc.css('.lshpanel').each |link| binding.pry puts link.elements[1].text puts "links are: " ## cant figure out how links... end can please help! been working on hr , cant figure out.
you can locate links css method , iterate on collection pull href attributes. example:
require 'nokogiri' require 'open-uri' doc = nokogiri::html(open('http://www.stream2u.me/')) doc.css('.lshpanel').each |d| puts d.css('.lshevent').text d.css('a').each { |el| puts el['href'] } end ruby nokogiri
Comments
Post a Comment