import bs4
import requests
url ="https://www.passiton.com/inspirational-quotes?page=2"
response = requests.get(url)
soup = bs4.BeautifulSoup(response.content)
article_element = soup.findAll('img')
for i, article in enumerate(article_element):
with open('inspiration{}.jpg'.format(i),'wb') as file:
img_url = article.img.attrs['src']
response = requests.get(img_url)
file.write(response.content)
AttributeError: 'NoneType' object has no attribute 'attrs', I am getting this error while trying to scrapping images from the url. How can I fix it? Please help me with this error