Re: download complete webpage with python

Discussion in 'Python' started by Gabriel Genellina, Dec 8, 2007.

  1. En Fri, 07 Dec 2007 17:58:43 -0300, yi zhang <>
    escribió:

    > The urllib.urlretrieve() can only download the text part of a webpage,
    > not the image associated. How can I download the whole, complete webpage
    > with python? Thanks!


    The images are separate from the html document. You have to parse the html
    text, find the <img> tags, and retrieve them.

    --
    Gabriel Genellina
     
    Gabriel Genellina, Dec 8, 2007
    #1
    1. Advertising

  2. Gabriel Genellina

    Larry Bates Guest

    Gabriel Genellina wrote:
    > En Fri, 07 Dec 2007 17:58:43 -0300, yi zhang <>
    > escribió:
    >
    >> The urllib.urlretrieve() can only download the text part of a webpage,
    >> not the image associated. How can I download the whole, complete
    >> webpage with python? Thanks!

    >
    > The images are separate from the html document. You have to parse the
    > html text, find the <img> tags, and retrieve them.
    >

    Actually IMHO this is even more difficult than it sounds. Javascript can change
    the webpage after it loads.

    Larry
     
    Larry Bates, Dec 8, 2007
    #2
    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. Replies:
    1
    Views:
    477
  2. Paul
    Replies:
    14
    Views:
    900
    Alexey Smirnov
    Jun 19, 2008
  3. Prime Mover
    Replies:
    3
    Views:
    342
    Dave Miller
    Mar 8, 2009
  4. sifar
    Replies:
    5
    Views:
    471
  5. soren625
    Replies:
    2
    Views:
    406
    soren625
    Dec 12, 2006
Loading...

Share This Page