BeautifulSoup also supports selecting elements by multiple tags. To achieve that, we use the function find_all, and we send a list of tags we want to extract.
For example, to extract and elements, we send the tags as a list like this:
from bs4 import BeautifulSoup
html_content = '''
Paragraph
Span
Bold
'''
soup = BeautifulSoup(html_content, 'html.parser')
headers_and_bold_text = soup.find_all(["h1", "b"])
for element in headers_and_bold_text:
print(element)
# Output:
#
# Bold
