Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # also import email.errors
- url = 'https://www.jbhifi.com.au/products/ultimate-ears-boom-3-portable-bluetooth-speaker-night-black'
- try:
- res = requests.get(url)
- res.raise_for_status()
- except requests.exceptions.HTTPError as err:
- raise SystemExit(err)
- soup = BeautifulSoup(res.text, 'html.parser')
- mySpan = float(soup.find("span", class_="price").text.replace("$", ""))
- try:
- if mySpan <= 180:
- sendEmail()
- else:
- print("Price is high")
- except MessageError as e:
- print(f"Email not sent: {e}")
Advertisement
Add Comment
Please, Sign In to add comment