Webscraping pass it on image scraping

In the pass it on,inspirational quotes task, i am unable to scrap the image url.
The site has changed its code a bit so i have modified my code accordingly, but still when i extract ‘src’ for image, it is not getting its URL.
My div tag is not getting the URL either.

Hi Pratyush,

You are not accessing the correct div.

div_element = soup.find('div', attrs = {"id" : 'all_quotes'})
img = div_element.find_all('img')

with open('inspiration_2.jpg','wb') as file:
    img_url = img[1].attrs['src']
    response = requests.get(img_url)
    
    file.write(response.content)

Use this code to get the image source.

Thanks :slight_smile:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.