I've previously built a BBC scraper which, among other things, scrape the headline from a given article such as this. However, BBC has recently changed their website, so I need to modify my scraper, which has proven to be difficult. For example, say I want to scrape the headline from the previously mentioned article. Inspecting the HTML using Firefox, I find the corresponding HTML attribute, which is data-component="headline-block" (see the blue marked line in the image).
If I want to extract the corresponding tag, I'll do this:
import requests
from bs4 import BeautifulSoup
url = 'https://www.bbc.com/news/world-africa-68504329'
# extract html
html = requests.get(url).text
# parse html
soup = BeautifulSoup(html, 'html.parser')
# extract headline from soup
head = soup.find(attrs = {'data-component': 'headline-block'})
But when I print the value of head it returns None, which means that Beautiful Soup can't find the tag. What am I missing? How do I solve this problem?

The data you see on the page is stored in Json form inside the page (so beautifulsoup doesn't see it). To get the headline + article text you can use this example:
Prints: