I wish to write the beautifulsoup form with this code:
soup = BeautifulSoup(con.content)
f = open('/*/*/Desktop/littletext.rtf','w')
f.write(str(soup))
f.close()
I get this error:
Traceback (most recent call last): File "///Desktop/test123.py", line 10, in f.write(soup) TypeError: must be str, not BeautifulSoup
Any ideas how to fix this? I tried to convert 'soup' to string but didn't work -- f.write(str(soup))
f.write(str(soup))? - jonrsharpeUnicodeEncodeErrors specifically or Unicode in Python generally, or e.g. docs.python.org/3/howto/unicode.html? - jonrsharpe