title: Can't remove line breaks from BeautifulSoup text output (Python 2.7.5)
body: <p>I'm trying to write a program to parse a series of HTML files and store the resulting data in a .csv spreadsheet, which is incredibly reliant on newlines being in exactly the right place. I've tried every method I can find to strip the linebreaks away from certain pieces of text, to no avail. The relevant code looks like this:</p>
  
  <pre><code>soup = BeautifulSoup(f)
  ID = soup.td.get_text()
  ID.strip()
  ID.rstrip()
  ID.replace("\t", "").replace("\r", "").replace("\n", "")
  dateCreated = soup.td.find_next("td").get_text()
  dateCreated.replace("\t", "").replace("\r", "").replace("\n", "")
  dateCreated.strip()
  dateCreated.rstrip()
  # debug
  print('ID:' + ID + 'Date Created:' + dateCreated)
  </code></pre>
  
  <p>And the resulting code looks like this:</p>
  
  <pre><code>ID:
  FOO
  Date Created:
  BAR
  </code></pre>
  
  <p>This and another problem with the same program have been driving me up the wall. Help would be fantastic. Thanks.</p>
  
  <p>EDIT: Figured it out, and it was a pretty stupid mistake. Instead of just doing </p>
  
  <pre><code>ID.replace("\t", "").replace("\r", "").replace("\n", "")
  </code></pre>
  
  <p>I should have done</p>
  
  <pre><code>ID = ID.replace("\t", "").replace("\r", "").replace("\n", "")
  </code></pre>