首页 新闻 会员 周边 捐助

为什么输出title?

0
悬赏园豆:5 [待解决问题]

html="""
<html><head><title>the dormouse's story</title></head>
<body>
<p class="title" name="dromouse"><b>the dormouse's story</b></p>
<p class="story">once upon a time there were three little sisters;and their names were
<a href="http//example.com/elsie" class="sister" id="link1"><!--elsie--></a>
<a href="http://example.com/lacie" class="sister" id="link2">lacie</a>and
<a href="http://example.com/title" class="sister" id="link3">title</a>;
and they lived at the bottom of a well.</p>
<p class="story">...</p>
"""
soup=BeautifulSoup(html,”lxml")
print(soup.title.name)

输出结果为什么是title?不应该是dromouse?

lxm_001的主页 lxm_001 | 初学一级 | 园豆:199
提问于:2019-05-16 20:26
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册