Skip to content

This repository shows how to scrape Google Maps' places reviews data using SerpApi. Total 3 places' reviews are scraped in this code file, by filtering only Indonesian reviews. Google Maps API has also been used to find out place_id for 3 places.

Notifications You must be signed in to change notification settings

sachelsout/scraping-google-maps-reviews

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

scraping-google-maps-reviews

This repository shows how to scrape Google Maps' places reviews data using SerpApi. Total 3 places' reviews are scraped in this code file, by filtering only Indonesian reviews. Google Maps API has also been used to find out place_id for 3 places.

Motivation to do this project

I've been applying to AI/ML related tasks/jobs on Upwork, and got this scraping job (which paid me 20$ to complete the scraping task). I had done some scraping before, but I got to learn a lot while doing this task. I tried using Selenium to scrape the data, but Google services are very restricted to scrape. Also, I tried Google Maps API but it has a limitation of only 5 reviews to scrape.
At last, I tried SerpApi from which I was able to scrape the google maps reviews data successfully. Although SerpApi is a paid service, we can use their Free Tier service in which they provide 100 requests limit per month.

What is scraping

image
Python web scraping is an automated method used for collecting large amounts of data from websites and storing it in a structured form. If we try to do it manually, it requires a lot of time and manpower, also resulting in human errors. So it's always better to scrape the required data using Scraping.

Step-by-step methods followed in this project

  1. Required installs/imports for serpapi, pagination, creating dataframes.
  2. Setting parameters for serpapi API calls for scraping maps data as well as places' reviews data.
  3. Make API call and get the required data in dict format. Do this for all the reviews using pagination.
  4. Extract reviewers' names and their reviews, store it in dataframe, filter only Indonesian reviews (API call scrapes both Indonesian and English reviews, sorting Indonesian reviews first. So locate where Indonesian reviews end and consider only those reviews).
  5. Create a CSV file to store these Indonesian Google Maps reviews.

Note :- Follow the same above steps for remaining 2 google maps places.

Sample Indonesian reviews scraped -

image

About

This repository shows how to scrape Google Maps' places reviews data using SerpApi. Total 3 places' reviews are scraped in this code file, by filtering only Indonesian reviews. Google Maps API has also been used to find out place_id for 3 places.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published