📌  相关文章
📜  将页面源写入文本文件 python 代码示例

📅  最后修改于: 2022-03-11 14:46:09.824000             🧑  作者: Mango

代码示例1
import requests

url = "https://stackoverflow.com/questions/24297257/save-html-of-some-website-in-a-txt-file-with-python"

r = requests.get(url)
with open('file.txt', 'w') as file:
    file.write(r.text)