assemble a webpage!

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Dec 17 01:14:24 EST 2007


En Thu, 13 Dec 2007 19:18:48 -0300, yi zhang <zhang1025 at yahoo.com>  
escribi�:

> Now I am able to use urlretrieve to download the text part of a webpage  
> and wget to get the embedded image. Thanks for the tips!
> but how can I assemble them together so the image can be displayed in  
> the webpage automatically once I click on the .html file.
> Right now I only saw the text part of the webpage when I click on it,  
> even I put the .html file and image file in the same directory.
> Any script can do this job?

You have to replace all references to external images in the HTML source,  
with local ones. That is, replace <img  
src="http://aaa.bbb.com/ddd/images/circle.jpg"> to <img src="circle.jpg">  
and place circle.jpg in the same directory as the html. The same for  
background images, css, etc.

wget can also do that for you, so why insist on using Python?

-- 
Gabriel Genellina




More information about the Python-list mailing list