Re: [BangPypers] Newspaper in Python

2015-04-24 Thread Nimish Dalal
; for article in Sc_paper.articles: > fh.write(article) > > > > -Mandar > > On Fri, Apr 24, 2015 at 2:18 PM, Prince Sharma > wrote: > > > No problem, however i forgot to close the file handle. You can start > > solving problem from there ;) > > > >

Re: [BangPypers] Newspaper in Python

2015-04-24 Thread Nimish Dalal
ple who spared your time to resolve the issue. Someday I think I will be intelligent enuf to share my knowledge and resolve noob's problems. Haha.. > On Apr 24, 2015 1:20 PM, "Nimish Dalal" wrote: > > > On Fri, Apr 24, 2015 at 12:29 PM, Prince Sharma > > wr

Re: [BangPypers] Newspaper in Python

2015-04-24 Thread Nimish Dalal
) > outfile.write(article.url) # Write to file > outfile.write('\n') > > outfile.close() # Close the file handle > > This should work. > > Wow! That actually worked for me. Thank you very much. I appreciate that. > On Fri, Apr 24, 2015 at 1:23 PM, Nim

Re: [BangPypers] Newspaper in Python

2015-04-24 Thread Nimish Dalal
On Fri, Apr 24, 2015 at 12:48 PM, sshabin...@gmail.com wrote: > -OR- > > import newspaper > > articles = [ ] > Sc_paper = newspaper.build(u'http://scroll.in/') > > for article in Sc_paper.articles: > articles.append(article) > > with open("filename", "w") as f: > f.write( "\n".join(articl

Re: [BangPypers] Newspaper in Python

2015-04-24 Thread Nimish Dalal
On Fri, Apr 24, 2015 at 12:29 PM, Prince Sharma wrote: > By export you mean you want to create a text file for every URL? > Hey Prince, I want all the urls to be compiled in a text file. Hi, I am new to python and need help with newspaper. > I am using this module as I find it easier to extract

Re: [BangPypers] Newspaper in Python

2015-04-24 Thread Nimish Dalal
te(article) # Write to file outfile.write('\n') outfile.close() TypeError: expected a character buffer object. > On Fri, Apr 24, 2015 at 12:16 PM, Nimish Dalal > wrote: > > > Hi, I am new to python and need help with newspaper. > > I am using this module a

[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] Simple and profound python tricks

2015-04-03 Thread Nimish Dalal
Excellent guys. This is definitely going to help n00bs like me who recently got started learning python. On Fri, Apr 3, 2015 at 12:20 PM, Dinakar K wrote: > Hi Guys, > > We built a useful page about simple and profound python tricks > and got a very good response from reddit > > here is the link

Re: [BangPypers] ImportError: cannot import name 'unquote'

2015-03-20 Thread Nimish Dalal
> >>>slug = quote('/profile/guido van') > >>>slug > '/profile/guido%20van' > >>>unquote(slug) > '/profile/guido van' > ``` > > > > On Fri, Mar 20, 2015 at 10:56 PM, Gora Mohanty wrote: &

Re: [BangPypers] ImportError: cannot import name 'unquote'

2015-03-20 Thread Nimish Dalal
I installed Anaconda version 2.1.0 python 3.4.1 On Fri, Mar 20, 2015 at 10:09 PM, Nitin Kumar wrote: > Which version of Python are you using. Older version (<2.6) of Python > urllib didn't had unquote. > > Nitin K > > On Fri, Mar 20, 2015 at 8:43 PM, Nimish Dalal >

[BangPypers] ImportError: cannot import name 'unquote'

2015-03-20 Thread Nimish Dalal
Guys, I am new to python. I am using ipython notebook on windows 7 platform. I get an error when I mention "from urllib import unquote" ImportError: cannot import name 'unquote' Thank you in advance. ___ BangPypers mailing list BangPypers@python.org htt