Python Requests 写入抓取的内容并写入文件

举人 / 2023-05-17 / 原文

code = res.status_code
print(code)

if code == 200:
with open('./JoeTest.html', 'w', encoding='utf-8') as fp:
fp.write(res.text)