DEV Community


How to do Web Scraping with Ruby on Rails?

botreetech profile image BoTree Technologies Originally published at on ・1 min read

![web scraping with ruby (

This article is about How to do simple ruby web scraping by processing CSV.

In this article, we will create a Ruby on Rails application to scrap the link uploaded from a CSV file and find the occurrence of the link on a particular page.

In the below Ruby on Rails application development, the user needs to pass a CSV file and list of the user’s email to whom the parsed CSV will be sent.

In the CSV file, there will be 2 columns

  1. referal_link
  2. home_link

Let’s start creating a Rails Application

  • Run the below command to create a new rails application

$ rails new scrape_csv_data

$ cd scrape_csv_data

  • Then, we will generate an Upload CSV module. Run the below command.

$ rails g scaffold UploadCsv generated_csv:string

This will create all the required models, controllers, and migrations for csv_file. Run the migration using the below command.

The post How to do Web Scraping with Ruby by Processing CSV appeared first on BoTree Technologies.

Discussion (0)

Editor guide