urllib.urlretrieve error

Discussion in 'Python' started by Sam Sungshik Kong, May 23, 2004.

  1. Hello!

    I'm trying to download PDF files from web to my computer using urllib.
    Some pdf files are fine but other files are downloaded only 6kB which is
    wrong.
    It didn't show any error message.

    I use urllib.urlretrieve(url, fn).

    So I tried to download with Internet Explorer and it worked fine.

    Anyone knows why?


    My another question is how I can retrieve "mms:..." files.
    urllib.urlretrieve doesn't work with that protocol.

    Thanks.

    Sam
     
    Sam Sungshik Kong, May 23, 2004
    #1
    1. Advertising

  2. Sam Sungshik Kong

    John J. Lee Guest

    "Sam Sungshik Kong" <> writes:

    > Hello!


    Hello!

    > I'm trying to download PDF files from web to my computer using urllib.
    > Some pdf files are fine but other files are downloaded only 6kB which is
    > wrong.
    > It didn't show any error message.
    >
    > I use urllib.urlretrieve(url, fn).
    >
    > So I tried to download with Internet Explorer and it worked fine.
    >
    > Anyone knows why?


    What was the content of the 6kb file? Don't assume it was the first
    6kb of the PDF file: for instance, it may be an HTML page.


    > My another question is how I can retrieve "mms:..." files.
    > urllib.urlretrieve doesn't work with that protocol.


    IIRC, that's a proprietary Microsoft scheme that's designed for
    'streaming' (ie. downloading and playing back the contents at the same
    time). I think there's a dodgy C program around somewhere which is
    just about able to grab them, but I don't know of a Python-accessible
    implementation.


    John
     
    John J. Lee, May 24, 2004
    #2
    1. Advertising

  3. Thanks for the reply.

    The problem was that url was wrong.
    It's not the library's fault...:)

    Thanks again.

    Sam

    "John J. Lee" <> wrote in message
    news:...
    > "Sam Sungshik Kong" <> writes:
    >
    > > Hello!

    >
    > Hello!
    >
    > > I'm trying to download PDF files from web to my computer using urllib.
    > > Some pdf files are fine but other files are downloaded only 6kB which is
    > > wrong.
    > > It didn't show any error message.
    > >
    > > I use urllib.urlretrieve(url, fn).
    > >
    > > So I tried to download with Internet Explorer and it worked fine.
    > >
    > > Anyone knows why?

    >
    > What was the content of the 6kb file? Don't assume it was the first
    > 6kb of the PDF file: for instance, it may be an HTML page.
    >
    >
    > > My another question is how I can retrieve "mms:..." files.
    > > urllib.urlretrieve doesn't work with that protocol.

    >
    > IIRC, that's a proprietary Microsoft scheme that's designed for
    > 'streaming' (ie. downloading and playing back the contents at the same
    > time). I think there's a dodgy C program around somewhere which is
    > just about able to grab them, but I don't know of a Python-accessible
    > implementation.
    >
    >
    > John
     
    Sam Sungshik Kong, May 24, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ralobao

    Problem with urllib.urlretrieve

    ralobao, Jun 12, 2004, in forum: Python
    Replies:
    1
    Views:
    823
    fishboy
    Jun 12, 2004
  2. Abandoned

    configure urllib.urlretrieve timeout

    Abandoned, Oct 7, 2007, in forum: Python
    Replies:
    1
    Views:
    646
    Steve Holden
    Oct 7, 2007
  3. samwyse
    Replies:
    3
    Views:
    2,116
  4. Juanlu_001
    Replies:
    0
    Views:
    521
    Juanlu_001
    Dec 26, 2010
  5. Даниил Рыжков

    urllib, urlretrieve method, how to get headers?

    Даниил Рыжков, Jul 1, 2011, in forum: Python
    Replies:
    6
    Views:
    1,085
    Даниил Рыжков
    Jul 2, 2011
Loading...

Share This Page