Skip to content

Instantly share code, notes, and snippets.

@AngeloFaella
AngeloFaella / scraper.py
Last active October 13, 2021 09:39
Python Amazon Scraper: simple python script to get notified (via email) when the price of a certain product falls below a certain threshold. Full explanation here: https://levelup.gitconnected.com/simple-web-scraping-with-python-1692c11e3b1a
from bs4 import BeautifulSoup
import requests
import smtplib
def check_price() -> int:
# get HTML page
user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36'
headers = {"user-agent": user_agent}
req = requests.get(URL, headers=headers)
@AngeloFaella
AngeloFaella / serieA_scraper.py
Last active February 28, 2020 17:12
Python Web Scraper: get the table of Serie A league from legaseriea.it. I used this scraper in this project: https://github.com/AngeloFaella/serie_A_analysis
from bs4 import BeautifulSoup
import requests
links = ['http://www.legaseriea.it/it/serie-a/classifica/2018-19',
'http://www.legaseriea.it/it/serie-a/classifica/2017-18',
'http://www.legaseriea.it/it/serie-a/classifica/2016-17',
'http://www.legaseriea.it/it/serie-a/classifica/2015-16',
'http://www.legaseriea.it/it/serie-a/classifica/2014-15',
'http://www.legaseriea.it/it/serie-a/classifica/2013-14',