Вот фрагмент кода, который предназначен для возврата текста с идентификатором html названия продукта, а затем для цены, но, по-видимому, он не может получить доступ к html коду страницы продукта Amazon.
def getPrice():
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()
print(title)
print(price)
Ошибка в названии вопроса заключается в следующих строках:
title = soup.find(id="productTitle").get_text()
price = soup.find(id="priceblock_ourprice").get_text()