Exhaustive list of SPDX (Software Package Data Exchange) licenses: https://spdx.org/licenses/
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
# Blog post: https://serpapi.com/blog/web-scraping-all-questions-from-researchgate-search-in-python/ | |
from parsel import Selector | |
from playwright.sync_api import sync_playwright | |
import json | |
def scrape_researchgate_questions(query: str): | |
with sync_playwright() as p: |
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") |
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" |
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 |
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" | |
} |
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 |
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", |
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 |
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