DEV Community

BoTree Technologies
BoTree Technologies

Posted on • Originally published at botreetechnologies.com on

1 1

How to do Web Scraping with Ruby on Rails?

![web scraping with ruby (https://www.botreetechnologies.com/blog/wp-content/uploads/2021/02/web-scraping-with-ruby.png)

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
csv_file: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.

Top comments (0)

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay