Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from bs4 import BeautifulSoup
- import requests
- import html5lib
- import wget
- pesquisaProduto = str('naruto')
- requestMercadoLivre = requests.get('https://lista.mercadolivre.com.br/' + pesquisaProduto)
- with open('localizado.html','w',encoding='utf-8') as file:
- file.write(requestMercadoLivre.text)
- with open('localizado.html','r',encoding='utf-8') as f:
- soup = BeautifulSoup(f.read(),'html5lib')
- foto = soup.find('img',class_='lazy-load')['src']
- #print(soup.find(class_='figure item-image item__js-link')['href'])
- wget.download(foto)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement