Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. from bs4 import BeautifulSoup
  2. import requests
  3. from time import sleep
  4. from datetime import datetime
  5. import smtplib
  6.  
  7. page = requests.get('https://www.terabyteshop.com.br/produto/5945/monitor-gamer-benq-zowie-xl2411-full-hd-24-pol-144hz-1ms-c-hdmi')
  8.  
  9. soup = BeautifulSoup(page.content, 'html.parser')
  10.  
  11. price = soup.find_all("p", class_="val-prod")[0].text
  12.  
  13. print(price)
  14.  
  15. smtp = smtplib.SMTP('smtp.live.com', 587)
  16. smtp.starttls()
  17.  
  18. smtp.login('seu_email', 'sua_senha.')
  19.  
  20. de = 'seu_email'
  21. para = ['email_destino']
  22. msg = """From: %s
  23. To: %s
  24. Subject: Preco Monitor = %s""" % (de, ', '.join(para), price)
  25.  
  26. smtp.sendmail(de, para, msg)
  27.  
  28. smtp.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement