title: Store Scraped data to a text file in Python
body: <p>I am able to scrape data using Beautifulsoup and now looking to generate a file containing all the data from which I scraped using Beautiful Soup. </p>
  
  <pre><code>file = open("copy.txt", "w") 
  data = soup.get_text()
  data
  file.write(soup.get_text()) 
  file.close() 
  </code></pre>
  
  <p>I don't see all the tag and entire content in the text file. Any Idea on how to achieve it? </p>