37,719
社区成员
发帖
与我相关
我的任务
分享
from bs4 import BeautifulSoup
html = """
<html>
<head>
<title>- -</title>
</head>
<body>
<p class="title" name="blog"><b>My Blog</b></p>
<li><!--注释--></li>
<a href="http://blog.csdn.net/c406495762/article/details/58716886" class="sister" id="link1">Python3网络爬虫(一):利用urllib进行简单的网页抓取</a><br/>
<a href="http://blog.csdn.net/c406495762/article/details/59095864" class="sister" id="link2">Python3网络爬虫(二):利用urllib.urlopen发送数据</a><br/>
<a href="http://blog.csdn.net/c406495762/article/details/59488464" class="sister" id="link3">Python3网络爬虫(三):urllib.error异常</a><br/>
</body>
</html>
"""
if __name__ == '__main__':
soup = BeautifulSoup(html,'lxml')
print(soup.title)