Created
March 18, 2017 18:50
-
-
Save 5hanth/58bca01a4d3a927eecb977a91d12de20 to your computer and use it in GitHub Desktop.
Vegetable Price Chennai
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
require 'nokogiri' | |
require 'open-uri' | |
doc = Nokogiri::HTML(open('http://www.livechennai.com/Vegetable_price_chennai.asp')) | |
table = doc.css("table.table-price tr") | |
parse = -> (i) { i.css('td').drop(1).map{|j| j.css('p')[0].content.strip.chop.strip}.join } | |
puts table.drop(1).map(&parse) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment