From: Sandeep Guria Date: 2011-02-15T23:41:25+09:00 Subject: Ruby(and programming) beginners question regarding 'NoMethodError' while using Hpricot Hi! I am trying to build a web scraper which fetches Fundamental data for listed companies from finance websites. let me show an example. " PE ratio 16.8314/02/11 EPS (Rs) 10.59Mar, 10 Sales (Rs crore) 13,963.81Dec, 10 Face Value (Rs)10  Net profit margin (%) 17.72Mar, 10 Last dividend (%)3018/01/11 Return on average equity13.69Mar, 10 " I want to the data '16.83' from the above html , so what I do is I parse the HTML file and save it into doc. I search doc for inner text 'PE ratio' And then I chose the next element using next_sibling. But I am getting an error 'C:\Users\Administrator\Documents>ruby scraper.rb scraper.rb:9:in `
': undefined method `next_sibling' for # "PE ratio" }]> (NoMethodError)' I'll be grateful for any suggestions . Sorry about the formatting of the HTML Text! Attachments: http://www.ruby-forum.com/attachment/5911/scraper.rb -- Posted via http://www.ruby-forum.com/.