Zomato web scrapper, (Web App)

January 02 2022

The purpose of this code is to collect data from Zomato-registered hotels and restaurants in a particular city and provide a CSV file based on the most recent orders placed by customers, allowing new food businesses to assess their competitors. The information (dishes and their orders with prices) at the top may also be scraped if you first scrape the CSV (any practicable digit).

zomato-web-scrapper

Task

  1. Scrap the data from the zomato site.
  2. Required to load whole data on the site.
  3. Data for order details are missing for some ventures.
  4. Get the array of objects to store in a file as JSON Objects

Technical Details

  • Puppeteer ( Known as a Headless Chrome Node API, it is useful for automating the Chrome browser to run website tests )
  • NodeJS file system
  • NPM XLSX library ( to convert JSON to CSV file).

Problem

On the first load, zomato fetches fewer data. It is needed to fetch the whole data set by scrolling to the bottom and waiting for the data to fetch. It was a challenge to scrap the number of orders with the venture name while keeping the mind that some venture has no data for the number of orders.

Solution

So, I scrapped a block of data, having more details like name, rating, other details, and the number of orders.

After getting the array of strings, it is needed to split up the string into an array. The results array of index 1 is the venture name and the array of the last index is the number of orders. After that, I replaced the text with the string using “RegEx”,  which in the results gives the number of orders.

Soon, I will publish a “how it works” blog on this 😀

Get GitHub code here

Edit (October 2022)

I have built the Web Application of this great project as, it should be easy to use by everyone 😁.

Fooner

Technical Detail update:

  1. React JS
  2. Typescript
  3. Tailwind CSS
  4. Express JS
  5. Rest API

 

What's new?

Filter

Filter_fooner

  • Filter to filter out the data in different sections like
    • Sorting (Order): To order from increasing to decreasing or vice versa.
    • Cuisine (Particular cuisine): To show only businesses selling in the niche.
    • Rating: To show only businesses having a certain rating or above.
    • Split: To show top 20, top 10, below 20, or below 10.

 

 

Overall

Average-Idea_fooner

  • It will tell you an overall idea of the result, according to your filter if applied.

 

 

Orders Placed

Orders-Placed_fooner

  • It tells the number of orders a particular food business gets in a sorted way.
  • This will help you to know the competition and how to improve from them to improve.

 

 

Popular-Cuisine_fooner

  • This shows the cuisine in the category is the most or least favorable by the people at the time you searched for the insights.
  • This will help you to focus on certain types of cuisine to get most of the orders, to scale up the business.

 

 

No. of businesses in different Locations

Businesses-in-Different-Locations_fooner

  • This shows where most of the businesses have opened.
  • This will help you to open a business in certain locations to get a particular audience.

 

Suggestions are appreciated 😉

Live here