Skip to content

Instantly share code, notes, and snippets.

View oluwaseunladeinde's full-sized avatar

Oluwaseun Ladeinde oluwaseunladeinde

  • Everstream Nexus
  • Lagos, Nigeria
View GitHub Profile
@oluwaseunladeinde
oluwaseunladeinde / scraper.py
Last active June 24, 2020 13:31 — forked from AngeloFaella/scraper.py
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)