Coder Social home page Coder Social logo

farukalamai / yelp-scraper-scrapy-python Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 2.0 24 KB

Yelp Restaurant data scraping using python, scrapy spider

License: MIT License

Python 100.00%
ai-bot data-extraction data-mining data-scraper data-scraping python python-scraper scrapy scrapy-crawler scrapy-spider

yelp-scraper-scrapy-python's Introduction

Yelp Restaurant data scraping using python, scrapy spider

Top-10-Best-Restaurants-in-San-Francisco-CA-July-2023-Yelp

Deployment

1. Clone Repository

  git clone https://github.com/farukalampro/yelp-webscraper-using-scrapy-python.git
  cd yelp-webscraper-using-scrapy-python

2. Create Virtual Environment

  python -m venv env
  • For Windows:
  .\env\Scripts\activate
  • For macOS/Linux:
  source env/bin/activate

3. To install required packages

  pip install -r requirements.txt

4. Input your own link from yelp.com

  • Go to the data.py file. Insert link from Yelp
  • I have added one link in data.py as a sample. You can insert as many links as you want.
      start_urls = [
        # This is the sample URL
        # Here you have to put your own search link
        'https://www.yelp.com/search?find_desc=Restaurants&find_loc=San+Francisco%2C+CA' 
    ]

5. Run the command in the terminal

  scrapy crawl data -o sample_file.csv
  • you can download the data in any format. I have given the format below
  scrapy crawl "spider name" -o file_name.csv/json/xml
  • Here we have scraped some restaurant data which is in the Sample File folder

Important Note

  • As Yelp is continuously updating its website, so make sure you are updating xpath

yelp-scraper-scrapy-python's People

Contributors

farukalamai avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

frishtik imanmohi

yelp-scraper-scrapy-python's Issues

No longer working

Great idea for a project.
However, I did follow all instructions & it does run perfectly fine, but just creates an empty CSV...
Could it be an issue with website architecture changes? Your project was published not so long ago so it's odd.

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.