[BangPypers] help needed to in Client Cookie module

Ramchandra Apte maniandram01 at gmail.com
Wed Sep 19 17:30:39 CEST 2012


On 19 September 2012 16:09, suprabha ekka <suprabha.ekka at gmail.com> wrote:

> Hi ,
>
> I wanted to download a file from a content url . The content of the file is
> pdf/doc/docx/.xls/ any ms supported file.
> The simple text file i am able to download but i am unbal eto download any
> other file.
> The snippet of the code is :
>
> import urllib2
> import urllib
> import ClientCookie
>
> import sys
> cj = ClientCookie.LWPCookieJar()
> opener = ClientCookie.build_opener(urllib2.HTTPSHandler(),
> ClientCookie.HTTPCookieProcessor(cj))
> ClientCookie.install_opener(opener)
> # input-type values from the html form
> txtdata = {'userid':'****************','password':'**********************'}
> data = urllib.urlencode(txtdata)
>
> req3 = ClientCookie.Request("**************************8" ,data)
> handle3 = ClientCookie.urlopen(req3)
> content=handle3.read()
> print content
>
> Can any one tell me while i am able to download the content of simple text
> file but why i am not abl to  download the ppt/pdf/ etc file. and how can i
> do it.
> Can anyone respond ASAP.
>
> Thanks in advance.
>
> -Suprabha
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>
Please elobrate on the error (explain in more detail)


More information about the BangPypers mailing list