Advertisement
Jonatanpn

scrap no obtiene precio según producto

Nov 9th, 2020 (edited)
1,259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. from bs4 import BeautifulSoup
  2. import requests
  3. import smtplib
  4. import requests
  5. import os
  6. import datetime
  7. ######### IMPORTS ##########
  8. ############################
  9.  
  10. #########################################
  11. ######### Producto a comprobar ##########
  12. ASIN = "B087Q1GXHM"
  13. URL = (f"https://www.amazon.es/gp/product/{ASIN}")
  14. HEADERS = {"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 Safari/605.1.15"}
  15.  
  16. #PrecioAnteriorLimpio
  17. page = requests.get(URL, headers=HEADERS)
  18. soup = BeautifulSoup(page.content, 'lxml')
  19. PrecioActualSucio = soup.find(id='bundle-v2-btf-price-strikethrough')
  20.  
  21. print(f'{PrecioActualSucio}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement