WebサイトをHTMLとして保存する

WebサイトのHTMLファイルを テキスト形式 で保存します。

import requests
url="https://〇〇〇"
response=requests.get(url)
filename="file.txt"
with open(filename, mode="w",encoding="utf-8") as f:
    f.write(response.text)