Skip to content

Instantly share code, notes, and snippets.

Avatar
🇺🇦
Grateful. Donating to Ukraine

Dmitiry Zub☀️ dimitryzub

🇺🇦
Grateful. Donating to Ukraine
View GitHub Profile
@dimitryzub
dimitryzub / scrape-google-maps-place-python.py
Created Jun 22, 2022
Web Scraping Google Maps Place in Python | SerpApi
View scrape-google-maps-place-python.py
# video: https://www.youtube.com/watch?v=jqoNHXiGeZA
from serpapi import GoogleSearch
import json
params = {
"api_key": "your-serpapi-api-key", # Your SerpApi Api key
"engine": "google_maps", # SerpApi Parsing Engine
"google_domain": "google.com", # Google domain
"ll": "@47.6062572,-122.4086176,12z", # GPS Coordinates
@dimitryzub
dimitryzub / scrape-google-maps-place-reviews-python.py
Created Jun 22, 2022
How to scrape all Google Maps Reviews in Python | SerpApi
View scrape-google-maps-place-reviews-python.py
# video: https://www.youtube.com/watch?v=HQAWQPNjw_k
from serpapi import GoogleSearch
from urllib.parse import urlsplit, parse_qsl
import json
params = {
"api_key": "your sepapi api key", # your api key
"engine": "google_maps_reviews", # serpapi search engine
"hl": "en", # language of the search
@dimitryzub
dimitryzub / scrape-google-maps-photos-python.py
Last active Jun 22, 2022
Web Scrape Google Maps Photos with Python and SerpApi
View scrape-google-maps-photos-python.py
# video: https://www.youtube.com/watch?v=XM9d8zTYp_U
from serpapi import GoogleSearch
from urllib.parse import urlsplit, parse_qsl
import json
params = {
"api_key": "serpapi api key", # your api key
"engine": "google_maps_photos", # serpapi search engine
"hl": "en", # language of the search
@dimitryzub
dimitryzub / serpapi-google-maps-local-results-pagination.py
Created Jun 15, 2022
Scrape all Google Maps Local Results with Python and SerpApi
View serpapi-google-maps-local-results-pagination.py
from serpapi import GoogleSearch
from urllib.parse import urlsplit, parse_qsl
import pandas as pd
import json
params = {
"api_key": "YOUR-API-KEY", # your serpapi api key
"engine": "google_maps", # serpapi search engine
"type": "search", # type of the search. Search, Place..
"q": "Burger", # search query
@dimitryzub
dimitryzub / serpapi-google-maps-local-results-no-pagination.py
Created Jun 15, 2022
Scrape Google Maps Local Results with Python and SerpApi
View serpapi-google-maps-local-results-no-pagination.py
from serpapi import GoogleSearch
import json
params = {
"api_key": "YOUR-API-KEY", # your serpapi api key
"engine": "google_maps", # serpapi search engine
"type": "search", # type of the search. Search, Place..
"q": "Burger", # search query
"hl": "en", # language of the search
"ll": "@47.6080482,-122.3074315,13z" # GPS coordinates of location to search places from
@dimitryzub
dimitryzub / google-rank-tracker.py
Last active Jun 16, 2022
Google Rank Tracker in Python | Competitor Tracker
View google-rank-tracker.py
from serpapi import GoogleSearch
from datetime import date
import pandas as pd
import json
def google_website_ranker():
keywords = pd.read_csv("sample-keywords.csv")["Keywords"].to_list()
target_websites = pd.read_csv("sample-keywords.csv")["Target-Website"].to_list()
@dimitryzub
dimitryzub / walmart-search-product-across-all-walmart-store-ids.py
Created Jun 9, 2022
How to search for 1 specific product by SKU/UPC across all Walmart Store IDs
View walmart-search-product-across-all-walmart-store-ids.py
from serpapi import GoogleSearch
import pandas as pd
import json, os
walmart_store_ids = pd.read_json("serpapi-walmart-store-ids.json") # 4,640 stores
for store_id in walmart_store_ids["store_id"]:
params = {
"api_key": os.getenv("API_KEY"), # your serpapi api key
"engine": "walmart_product", # search engine
@dimitryzub
dimitryzub / google-scholar-author-results-serpapi.py
Created Jun 8, 2022
Scrape Google Scholar Author Profile and All Author Publications to CSV in Pyhton | SerpApi
View google-scholar-author-results-serpapi.py
from serpapi import GoogleSearch
from urllib.parse import urlsplit, parse_qsl
import pandas as pd
import os, json
def scrape_google_scholar_author():
params = {
"api_key": os.getenv("API_KEY"), # SerpApi API key
"engine": "google_scholar_author", # author results search engine
@dimitryzub
dimitryzub / google-scholar-organic-cite-results-to-csv.py
Last active Jun 13, 2022
Web Scraping Google Scholar Organic, Cite Results to CSV with Python | SerpApi
View google-scholar-organic-cite-results-to-csv.py
# Video tutorial - https://www.youtube.com/watch?v=IXcycQwpFH0
# https://serpapi.com/google-scholar-api
from serpapi import GoogleSearch
from urllib.parse import urlsplit, parse_qsl
import pandas as pd
import os, json
def scrape_organic_results():
@dimitryzub
dimitryzub / stackoverflow-scrape-all-google-play-app-reviews-playwright.py
Created Jun 3, 2022
Scrape all Google Play App Product Reviews with Python and Playwright
View stackoverflow-scrape-all-google-play-app-reviews-playwright.py
# https://stackoverflow.com/questions/54554261/selenium-unable-to-locate-app-id-title-element-when-trying-to-load-google-play/72490391#72490391
# https://replit.com/@DimitryZub1/Scrape-Google-Play-Store-App-Reviews-Bs4-SerpApi#playwright_solution.py
# https://serpapi.com/google-play-product-reviews
from playwright.sync_api import sync_playwright
import json, time, re
with sync_playwright() as p:
browser = p.chromium.launch(headless=True, slow_mo=50)
page = browser.new_page(user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36',