Saving a picture contained in a web page to disk

John Hunter jdhunter at ace.bsd.uchicago.edu
Thu Nov 27 09:14:33 EST 2003


>>>>> "Y2KYZFR1" == Y2KYZFR1  <jarrodhroberson at yahoo.com> writes:

    >> > Unfortunately the image is dynamic, so the url is actually a
    >> query > which looks like

    >> http://adfarm.mediaplex.com/ad/bn/2397-11787-1843-5?mpt=1068644406357385
    >> > 
    >> > rather than the standard
    >> > 
    >> >
    >> http://img-cdn.mediaplex.com/ads/2397/11787/q2_dell_inspiron_120x600.gif
    >> 

If the query is dynamic, you may need to sniff the HTTP headers to
find out what is going on behind the scenes.  Mozilla Firebird has a
'Live HTTP Headers' addon module that lets you captue and save the
headers as you browse.  You can then sort through them, find out what
is going on, and use the httplib module to code it in python.

Not easy, but doable.

JDH





More information about the Python-list mailing list