[BangPypers] Newspaper in Python

2015-04-23 Thread Nimish Dalal
Hi, I am new to python and need help with newspaper. I am using this module as I find it easier to extract the urls from the website. Here's my code: import newspaper Sc_paper = newspaper.build(u'http://scroll.in/') for article in Sc_paper.articles: print(article.url) http://scroll.in/... htt

Re: [BangPypers] Newspaper in Python

2015-04-23 Thread Dhawal Joharapurkar
This is a simple problem. 1. Create a file handle. 2. Write to the file using the file handle. 3. Close the file handle. import newspaper outfile = open('outfile.txt', 'a+) # Create a file handle Sc_paper = newspaper.build(u'http://scroll.in/') for article in Sc_paper.articles: print(articl