爬虫作业(3)
from bs4 import BeautifulSoup
html=BeautifulSoup("<!DOCTYPE html>\n<html>\n<head>\n<meta charset=‘utf-8‘>\n<title>菜鸟教程(runoob.com)</title>\n</head>\n<body>\n<h1>我的第一标题</h1>\n<p id=‘frist‘>我的第一段落。</p>\n</body>\n</table>\n</html>","html.parser")
print(html.head,"学号后两位:02")

import re r=html.text pattern=re.findall(u'[\u1100-\uFFFDh]+?',r) print(pattern)


浙公网安备 33010602011771号