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

Popular posts from this blog

php - How to pass multiple values from url -

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

database - php search bar when I press submit with nothing in the search bar it shows all the data -