Python BeautifulSoup Escreva para arquivo

with open("output1.html", "w", encoding='utf-8') as file:
    file.write(str(soup))
Dark Dog