Writing to a file in Python is usually a simple 2-liner, which is easy to be written:
1 2 |
with io.open("soup.txt", "w") as file: file.write(soup_written) |
However, problems with the encoding may cause some research needed. Concerning the encoding this is a great article from the creator of…