tags:

views:

86

answers:

1

I have an absolute URL, and the URL that a link on that page points to. Is there a builtin function to apply a relative URL to an absolute URL?

Ie. "http://example.com/some/url", "/some/url/I/want/to/go/to" => "http://example.com/some/url/I/want/to/go/to"

+5  A: 

urlparse.urljoin() does just this.

Ignacio Vazquez-Abrams