题目内容
已知爬取了一段网页源码字符串,将网页元素去掉,只保留需要的文字部分。代码如下import rehtml="wellcome
hello
hi
please
"pattern=re.compile(___________1____________)data=re._______2_________(pattern,' ',html) #把符合正则匹配的部分用“ ”空格来替换data=data.strip("")print("去掉网页元素后,获取的信息:",data) 查看答案
搜索结果不匹配?点我反馈