View scrape-google-finance-markets-page.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tutorial blog post: https://serpapi.com/blog/scrape-google-finance-markets-in-python/ | |
import requests | |
import json | |
import re | |
import argparse | |
from parsel import Selector | |
parser = argparse.ArgumentParser(prog="Google Finance Markets Options") | |
parser.add_argument('-i','--indexes', action="store_true") |
View scrape_google_finance_ticker_python.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nasdaqdatalink | |
import requests, json, re | |
from parsel import Selector | |
from itertools import zip_longest | |
def scrape_google_finance(ticker: str): | |
params = { | |
"hl": "en" # language | |
} |
View scrape-google-finance-main-page.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# original blog post: https://serpapi.com/blog/web-scraping-google-finance/ | |
import requests, json, re | |
from parsel import Selector | |
def scrape_google_finance_main_page(): | |
# https://docs.python-requests.org/en/master/user/quickstart/#custom-headers | |
# https://www.whatismybrowser.com/detect/what-is-my-user-agent | |
headers = { | |
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36" |
View scrape-google-images-python.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Step-by-step blog post: https://serpapi.com/blog/scrape-google-images-with-python/ | |
# There's an API solution with a video tutorial: https://www.youtube.com/watch?v=QuCPV6_GT6o | |
import os, requests, lxml, re, json, urllib.request | |
from bs4 import BeautifulSoup | |
from serpapi import GoogleSearch | |
headers = { | |
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36" | |
} |
View scrape-google-images-python-serpapi.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def serpapi_get_google_images(): | |
image_results = [] | |
for query in ["Coffee", "boat", "skyrim", "minecraft"]: | |
# search query parameters | |
params = { | |
"engine": "google", # search engine. Google, Bing, Yahoo, Naver, Baidu... | |
"q": query, # search query | |
"tbm": "isch", # image results |
View webscraping-all-goolgle-news-articles.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# video tutorial: https://www.youtube.com/watch?v=fOs_eOsLP54 | |
from serpapi import GoogleSearch | |
from urllib.parse import (parse_qsl, urlsplit) | |
params = { | |
"api_key": "...", # serpapi api key | |
"engine": "google", # search engine | |
"q": "minecraft", # search query | |
"gl": "us", # country of the search |
View serpapi-google-sports-results-timezone-format.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# AskSerpApi video: https://www.youtube.com/watch?v=c26LgucCqDo | |
from dateutil import parser | |
from serpapi import GoogleSearch | |
params = { | |
"api_key": "your serpapi api key", | |
"engine": "google", | |
"q": "liverpool", | |
"google_domain": "google.co.uk", |
View scrape-youtube-videos-python-serpapi.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# video tutorial: https://www.youtube.com/watch?v=PTLpbBiz_sc | |
from serpapi import GoogleSearch | |
from urllib.parse import (parse_qsl, urlsplit) | |
import json | |
params = { | |
"api_key": "your api key", # your serpapi api key | |
"engine": "youtube", # serpapi parsing engine | |
"search_query": "blender foundation", # search query |
View scrape-google-maps-photos-python.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
View scrape-google-maps-place-python.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
NewerOlder