Scraping divs with BeautifulSoup

Report a typo
Hey there! This problem might be a bit unpredictable, but give it a go and let us know how you do!
Given the Python code snippet:

import requests
from bs4 import BeautifulSoup

url = 'https://www.example.com'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')
How can you extract all 'div' elements with the class name 'content', get their 'id' attributes and store these ids in a Python dictionary where id is the key and text inside div is the value?
Select one or more options from the list

Create a free account to access the full topic