Skip to content

Instantly share code, notes, and snippets.

View dimitryzub's full-sized avatar
🇺🇦
Grateful

Dmitiry Zub☀️ dimitryzub

🇺🇦
Grateful
View GitHub Profile
@dimitryzub
dimitryzub / scrape-google-maps-place-reviews-python.py
Created June 22, 2022 06:46
How to scrape all Google Maps Reviews in Python | SerpApi
# 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 June 22, 2022 17:12
Web Scrape Google Maps Photos with Python and SerpApi
# 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 June 15, 2022 10:36
Scrape all Google Maps Local Results with Python and SerpApi
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 June 15, 2022 10:36
Scrape Google Maps Local Results with Python and SerpApi
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 June 16, 2022 09:30
Google Rank Tracker in Python | Competitor Tracker
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 June 9, 2022 08:40
How to search for 1 specific product by SKU/UPC across all Walmart Store IDs
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 June 8, 2022 10:28
Scrape Google Scholar Author Profile and All Author Publications to CSV in Pyhton | SerpApi
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 March 26, 2024 02:01
Web Scraping Google Scholar Organic, Cite Results to CSV with Python | SerpApi
# 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 June 3, 2022 13:40
Scrape all Google Play App Product Reviews with Python and Playwright
# 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',
@dimitryzub
dimitryzub / researchgate-scrape-all-authors.py
Last active February 5, 2024 00:24
Scrape ResearchGate all Author, Researchers profiles in Pytohn
# scraped url: https://www.researchgate.net/search/researcher?q=Coffee&page=1
# blog post:
from parsel import Selector
from playwright.sync_api import sync_playwright
import json
def scrape_researchgate_profile(query: str):
with sync_playwright() as p: