I am trying to clear HTML using Nokogiri but not getting the expected result.
At this specific URL, I was looking at transactions in a specific place and wanted to display the details of the transaction on this page. .small-deals-cont is the CSS selector for the page, and similarly .deal-title is the CSS selector for the deal name.
require 'rubygems' require 'nokogiri' require 'open-uri' url = "http://www.snapdeal.com/local-deals-Chennai-all?category=all&HID=dealHeader_all" doc =Nokogiri::HTML(open(url)) puts doc.at_css("title").text doc.css(".small-deals-cont").each do |item| puts item.at_css(".deal-title") end
Anu11 source share