from bs4 import BeautifulSoup
html = """
BeautifulSoup Test
Welcome to BeautifulSoup
- Item 1
- Item 2
- Item 3
"""
soup = BeautifulSoup(html, "html.parser")
# 利用find_all查找所有的li标签
li_tags = soup.find_all("li")
if li_tags:
for li in li_tags:
print(li.text)
else:
print("未找到任何li标签")