Beautiful Soup

- 30 words - 1 minute
apt install python3-bs4
import bs4

text = open('path-to-file.html').read()
soup = bs4.BeautifulSoup(text, features='lxml')
article = soup('article')[0]

tag.name
tag.attrs
tag['attribute']
tag['attribute'] = value
tag.get_attribute_list()
tag.string

items = tag.find_all('li')
containers = tag.find_all('div', class_='container')