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
# 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=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(): |
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 | |
} |
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
from bs4 import BeautifulSoup | |
import requests, lxml, os, json | |
headers = { | |
'User-agent': | |
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.19582" | |
} | |
proxies = { | |
'http': os.getenv('HTTP_PROXY') # or just type proxy here without os.getenv() |
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
# pip install google-search-results | |
import os, json | |
from serpapi import GoogleSearch | |
from urllib.parse import urlsplit, parse_qsl | |
def serpapi_scrape(query: str, website: str): | |
params = { | |
# https://docs.python.org/3/library/os.html#os.getenv | |
"api_key": os.getenv("API_KEY"), # your serpapi API key | |
"engine": "google_scholar", # search engine |
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: https://serpapi.com/blog/scrape-google-scholar-papers-within-a-particular-conference-in-python/ | |
from parsel import Selector | |
import requests, json, os | |
def check_sources(source: list or str): | |
if isinstance(source, str): | |
return source # NIPS | |
elif isinstance(source, list): |
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 |
NewerOlder