Hey I’m trying to write a very simple email scraper in Python 3, that asks the user for text of the emails and saves that to a .txt file.
I tried to aks the user for input and store it in a variable and then appending that variable to a text file. But that only saves the first line of the email to the text file. To me it looks like the variable in which i’m trying to store the email only saves the first line, and stops when it comes across a newline.
This is the code that I tried. But only writes first line to file.txt instead of the whole text. How can I make this work?
print("Paste text from email")
content = input(">")
file = open('file.txt','a')
file.write('\n' + '--new email--' + '\n' + content + "\n")