Converting relative URLs to absolute

Paul Boddie paul at boddie.net
Fri Mar 15 11:20:40 EST 2002


James A Roush <jar at mminternet.com> wrote in message news:<MPG.16f93563d41b508f989696 at news.mminternet.com>...
> 

[Handling relative and "rooted" links in Web pages]

> This precisely what I'm looking for.  As someone else pointed out in another 
> post, urllib should have this but, sadly, does not.

The module I mentioned [1] doesn't attempt to handle more
sophisticated URL types, such as...

  http://user@somesite/somepath

Indeed, a more generic URL parser really needs to be put into the
standard library whilst retaining the simplicity that one tends to see
in other "path" manipulation APIs (eg. os.path) - the world doesn't
need another overcomplicated Java-like API to do the simplest of
things. I wonder if mxURL might at least provide inspiration.

Paul

[1] http://www.boddie.org.uk/downloads/urlutils.py



More information about the Python-list mailing list