Last active
April 14, 2021 20:12
-
-
Save jorgezanguettin/3347a8b17978dd60403b301257e0cb3d to your computer and use it in GitHub Desktop.
analisar_requisicao_partial_2.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def analisar_requisicao(conteudoRequisicao): | |
objBs4 = BeautifulSoup(conteudoRequisicao, "html.parser") | |
marcas = objBs4.find_all('div', {'class': 'product-box-brand'}) | |
nomes = objBs4.select('div.catalog-content p.product-box-title') | |
links = objBs4.find_all('a', { | |
'class': 'product-box-link is-lazyloaded image product-image-rotate' | |
}) | |
precos = objBs4.find_all('span', {'class': 'product-box-price-from'}) | |
for marca, nome, link, preco in zip(marcas, nomes, links, precos): | |
marca = marca.text | |
nome = nome.text | |
link = link['href'] | |
preco = preco.text | |
print (f'{marca} | {nome} | {link} | {preco}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment