Coder Social home page Coder Social logo

swiggy-scraper's Introduction

Swiggy Scraper

A Scraping project to scrape restaurant information from Swiggy. This scraper is able to scrape data for entire Indian restaurants.

Data

The links of all the restaurants can be find in links.csv file and scraped data can be found in scrape_data.csv file. The following variables are saved:

  • Restaurant Name: Name of the restaurant
  • Longitude: Longitude coordinate of the restaurant's location
  • Latitude: Latitude coordinate of the restaurant's location
  • Price For Two: Cost for two in rupees
  • Region: Region where restaurant is located
  • Rating: Average rating out of 5

Libraries

Following libraries are used in this project:

  • BeautifulSoup
  • requests
  • re
  • json
  • pandas
  • time

About the code

The whole project is divided into two part:

  • Crawler: It will crawl the entire website and fetch required links i.e url of each restaurant.
  • Scraper: It will take each links fetched from crawler as input and will go to each page to extract the required information.

Techniques used

  • Headers: Python Requests does not force you to use request headers while sending requests but there are few smart websites that does not let you to extract any data without certain headers. So it is always good to set headers.

  • Time Delay: A delay of 5 seconds has been given after each url hit to prevent scraper from being blocked.

  • Multiprocessing: As there are more than 57,000 restaurants listed on swiggy so extracing data from each url with a delay of 5 second will take very long time. So to overcome this multiprocessing is used to speed up scraping.

swiggy-scraper's People

Contributors

kumarvivek9097 avatar

Stargazers

Vinay Yadav avatar

Watchers

Vinay Yadav avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.