Re: Download and save a picture - urllib

2009-09-24 Thread Piet van Oostrum
> MRAB (M) wrote: >M> mattia wrote: >>> You were right, the problem was with the print function, using a normal >>> write everythong works fine. >>> >M> You should open the output file as binary (it doesn't matter on >M> Linux/Unix, but is a good idea anyway for portability). It probably DO

Re: Download and save a picture - urllib

2009-09-10 Thread MRAB
mattia wrote: You were right, the problem was with the print function, using a normal write everythong works fine. You should open the output file as binary (it doesn't matter on Linux/Unix, but is a good idea anyway for portability). Il Thu, 10 Sep 2009 18:56:07 +0200, Diez B. Roggisch ha s

Re: Download and save a picture - urllib

2009-09-10 Thread mattia
You were right, the problem was with the print function, using a normal write everythong works fine. Il Thu, 10 Sep 2009 18:56:07 +0200, Diez B. Roggisch ha scritto: > mattia wrote: > >> Hi all, in order to download an image. In order to correctly retrieve >> the image I need to set the referer

Re: Download and save a picture - urllib

2009-09-10 Thread Diez B. Roggisch
mattia wrote: > Hi all, in order to download an image. In order to correctly retrieve the > image I need to set the referer and handle cookies. > > opener = urllib.request.build_opener(urllib.request.HTTPRedirectHandler > (), urllib.request.HTTPCookieProcessor()) > urllib.request.install_opener(o