Converting relative URLs to absolute

Fernando Pérez fperez528 at yahoo.com
Tue Mar 12 17:51:19 EST 2002


James A Roush wrote:

> Does anyone have any code that, given that absolute URL of a web page, can
> convert all the relative URLs on that page to their absolute equivalent?

Assuming absolute is a string and relative_list a list of strings, the 
followinng comes to mind:

[absolute+'/'+relative for relative in relative_list]

Maybe you wanted something fancier, don't know.

f



More information about the Python-list mailing list