from urllib.request import urlopen # 来自 网页模块.请求 导入 网页打开
url = "http://www.baidu.com"
resp = urlopen(url)
print(resp)
with open("mybaid.html", mode="w", encoding="utf-8") as f:
f.write(resp.read().decode("utf-8"))
Python 网页导入到html文件
于 2023-12-21 20:59:02 首次发布