I just started the project of an app that tracks Amazon prices. According to the tutorial video, at this step when I run the code it has to show the product's name and price, but the only thing that comes out is the next error: AttributeError: 'NoneType' object has no attribute 'get_text'. I already tried it with another pages and revised the same topics here but didn't find the answer. Please help ;(
The code itself:
import requests
from bs4 import BeautifulSoup
URL = 'https://www.amazon.es/dp/B07JQRWLXM/ref=nav_signin?pf_rd_r=FJX3CJC8RWFE3NPQJRNP&'
headers = {
"User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/86.0.4240.75 Safari/537.36'}
page = requests.get(URL, headers=headers)
soup = BeautifulSoup(page.content, 'html.parser')
title = soup.find(id="productTitle").get_text()
price = soup.find(id = "priceblock_ourprice").get_text()
converted_price = float(price[0:3])
print(converted_price)
print(title.strip())