beautiful soup take a certain tag from a webiste code example
Example 1: get all paragraph tags beautifulsoup
soup = BeautifulSoup('html_file', 'html.parser')
all_paragraphs = soup.find_all('p')
Example 2: tag inside tag beautifulsoup
html = """<div class="pr">
</div>
<li>
<a href="pr/protocol">
protocol
</a>
</li>"""
soup = BeautifulSoup(html, "lxml")
a = soup.select_one("div[class=pr]")
parent = soup.new_tag("li", class_="parent")
child = soup.new_tag("a", href="hm/test", class_="child")
child.string = 'TEST'
parent.append(child)
a.insert_after(parent)
print(soup.prettify())