2024-04-26 06:12:19 发布
网友
我在谷歌搜索了一些文本,并用html保存了页面
然而,当我打开它时,内容消失了
这是我保存的html的link
如何恢复内容
with open('sample.html', 'r') as f: text = f.read() '万象城上海首秀' in text # False, but it should be True
多谢各位
您可能需要为此使用^{}。以下是如何做到这一点:
>>> from bs4 import BeautifulSoup as bs >>> soup = bs(open("file.html","r").read(), "html.parser") >>> '万象城上海首秀' in soup.text True >>>
您可能需要为此使用^{} 。以下是如何做到这一点:
相关问题 更多 >
编程相关推荐