pywebcopy复制的网站是有什么解决办法吗?-灵析社区

瞳孔放大黑洞

第三方库: from bs4 import BeautifulSoup with open('path/to/your/saved/html/file.html', 'r', encoding='utf-8') as file: soup = BeautifulSoup(file, 'html.parser') if soup.meta: soup.meta['charset'] = 'utf-8' else: soup.head.append(soup.new_tag('meta', charset='utf-8')) with open('path/to/your/saved/html/file.html', 'w', encoding='utf-8') as file: file.write(str(soup))

阅读量:1

点赞量:0

问AI