title: Python Read URLs from File and print to file
body: <p>I have a list of URLs in a text file from which I want to fetch the article text, author and article title. When these three elements are obtained I want them to be written to a file. So far I can read the URLs from the text file but Python only prints out the URLS and one (the final article). How can I re-write my script in order for Python to read and write every single URL and content? </p>
  
  <p>I have to the following Python script (version 2.7 - Mac OS X Yosemite):</p>
  
  <pre><code>from newspaper import Article
  
  f = open('text.txt', 'r') #text file containing the URLS
  for line in f:
      print line
  
  url = line
  first_article = Article(url)
  first_article.download()
  
  first_article.parse()
  
  # write/append to file 
  with open('anothertest.txt', 'a') as f:
      f.write(first_article.title)
      f.write(first_article.text)
  
  print str(first_article.title)
  
  for authors in first_article.authors:
      print authors
  if not authors:
      print 'No author'
  
  print str(first_article.text)
  </code></pre>