📅  最后修改于: 2022-03-11 14:45:14.509000             🧑  作者: Mango
from bs4 import BeautifulSoup
# Html source
html = """
Recent Posts:
"""
# Parse
soup = BeautifulSoup(html, 'html.parser')
# Get h2 tag
h2 = soup.h2
# Print h2 parent
print(h2.parent)