Posts

Image
Data scraping in Ruby on Rails using Nokogiri and Mechanize gem What is Data scraping? Website/Data  Scraping  is a technique to  operating  large amounts of  data  from websites whereby the  data  is extracted and displayed in own sites or it can be stored to a File/Database. Data scraping is basically used where the websites does not provides API.  We are having the Sample application running on the local The above local site we will scrapped through the NokoGiri gem. The steps are required:  Add  the gem " gem 'nokogiri', '~> 1.8', '>= 1.8.1'" .  Then run the bundle install command. Add the "require 'nokogiri'" ,   "require 'open-uri'" line where you will write the code for the scraping.  staff_data = Nokogiri::HTML(open("http://localhost:4000/staffs")) staff_data = staff_data.to_yaml The Entire list of the staffs will be stored in the  staff_data    We can process t...