Well, the title says it all, I want to get the price of a product from link , which looks like this: / p>
<span class="nm-price-value" itemprop="price">R$ 367,60</span>
Using this code:
import bs4
import requests
def get_page(url):
r = requests.get(url)
try:
r.raise_for_status()
page = bs4.BeautifulSoup(r.text, 'lxml')
return page
except Exception as e:
return False
def pontofrio(search):
soup = get_page(f'https://search3.pontofrio.com.br/busca?q={search}')
price = [i.getText() for i in soup.select('.nm-price-value')]
product = [i.getText().upper() for i in soup.select('.nm-product-name a')]
link = [i.get('href') for i in soup.select('.nm-product-name a')]
return product, price, link
Since the product and link lists return normally, but the price list is returning:
['\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n']
Please help!