python使用爬虫技术抓取网页中的title标签

使用爬虫技术抓取网页中的title标签

 

 

import urllib.request
import re
page = urllib.request.urlopen('https://www.cnblogs.com')
html = page.read().decode('utf-8')
title=re.findall('<title>(.+)</title>',html)
print (title)

 

posted @ 2022-05-03 11:19  Mymcky  阅读(2697)  评论(0)    收藏  举报