What is Reddit's opinion of

""




Categories:

Check price

1 comment of this product found across Reddit:
Grimshah /r/learnpython
1 point
1970-01-20 08:06:46.754 +0000 UTC

So, the good news is that I'm not getting the error, however instead of getting an attribute error, I'm getting None instead when I try searching for the product title.

import requests
from bs4 import BeautifulSoup
URL = 'https://www.amazon.com/dp/B0B6HYGK65?\_encoding=UTF8&psc=1&ref\_=cm\_sw\_r\_cp\_ud\_dp\_Y7JZXMJ9H7CBK85N4NNN'
headers = {"User-Agent": 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'}
resp = requests.get(URL, headers=headers)
soup = BeautifulSoup(resp.text, "lxml")
item = soup.find(id="productTitle")
print(item)
_______________

None