title: Python3 Write to file beautifulsoup
body: <p>I wish to write the beautifulsoup form  with this code:</p>
  
  <pre><code>soup = BeautifulSoup(con.content)
  f = open('/*/*/Desktop/littletext.rtf','w')
  f.write(str(soup))
  f.close()
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>Traceback (most recent call last):
        File "/<em>/</em>/Desktop/test123.py", line 10, in 
        f.write(soup)
        TypeError: must be str, not BeautifulSoup</p>
  </blockquote>
  
  <p>Any ideas how to fix this? I tried to convert 'soup' to string but didn't work -- f.write(str(soup))</p>