Goal: what we will make by the end of the day

Step1: Use BeautifulSoup scrape the Product Price

import requests
from bs4 import BeautifulSoup

URL="<https://www.amazon.com/Instant-Pot-Duo-Evo-Plus/dp/B07W55DDFB/ref=sr_1_1?qid=1597662463>"

#TODO: Have to setup the header attributes for get back normal response 
headers = {
"Accept-Language":"zh-TW,zh;q=0.9,en-US;q=0.8,en;q=0.7,zh-CN;q=0.6,",
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"
}
#TODO:Put the header with URL request
response = requests.get(URL, headers=headers)
content = response.text
#TODO:Replace the parser as lxml
soup = BeautifulSoup(content, "lxml")
#TODO:Print out the response content
soup.prettify

Untitled

#TODO: Get price with specific CSS selector
price = soup.select_one(".a-offscreen").get_text()
price
product_title = soup.select(selector="#productTitle", class_=".a-size-base")[0].getText()
print(product_title)

Step2: Email Alert When Price Below Preset Vale