Trees | Indices | Help |
|
---|
Parse (absolute and relative) URLs.
See RFC 1808: "Relative Uniform Resource Locators", by R. Fielding, UC Irvine, June 1995.
'
'
,
allow_fragments=True)'
'
,
allow_fragments=True)[
'
ftp
'
,
'
http
'
,
'
gopher
'
,
'
nntp
'
,
'
imap
'
,
'
wai
...
[
'
ftp
'
,
'
http
'
,
'
gopher
'
,
'
nntp
'
,
'
telnet
'
,
'
ima
...
[
'
gopher
'
,
'
hdl
'
,
'
mailto
'
,
'
news
'
,
'
telnet
...
[
'
ftp
'
,
'
hdl
'
,
'
prospero
'
,
'
http
'
,
'
imap
'
,
'
http
...
[
'
http
'
,
'
wais
'
,
'
imap
'
,
'
https
'
,
'
shttp
'
,
'
mms
'
,
...
[
'
ftp
'
,
'
hdl
'
,
'
http
'
,
'
gopher
'
,
'
news
'
,
'
nntp
...
'
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST
...
20
{
}
'
\n http://a/b/c/d\n\n g:h = <UR
...
'
'
,
allow_fragments=True)
Parse a URL into 6 components: <scheme>://<netloc>/<path>;<params>?<query>#<fragment> Return a 6-tuple: (scheme, netloc, path, params, query, fragment). Note that we don't break the components up in smaller bits (e.g. netloc is a single string) and we don't expand % escapes.
'
'
,
allow_fragments=True)
Parse a URL into 5 components: <scheme>://<netloc>/<path>?<query>#<fragment> Return a 5-tuple: (scheme, netloc, path, query, fragment). Note that we don't break the components up in smaller bits (e.g. netloc is a single string) and we don't expand % escapes.
Put a parsed URL back together again. This may result in a slightly different, but equivalent URL, if the URL that was parsed originally had redundant delimiters, e.g. a ? with an empty query (the draft states that these are equivalent).
Removes any existing fragment from URL.
Returns a tuple of the defragmented URL and the fragment. If the URL contained no fragments, the second element is the empty string.
[
'
ftp
'
,
'
http
'
,
'
gopher
'
,
'
nntp
'
,
'
imap
'
,
'
wais
'
,
'
file
'
,
'
https
'
,
...
[
'
ftp
'
,
'
http
'
,
'
gopher
'
,
'
nntp
'
,
'
telnet
'
,
'
imap
'
,
'
wais
'
,
'
file
'
,
...
[
'
gopher
'
,
'
hdl
'
,
'
mailto
'
,
'
news
'
,
'
telnet
'
,
'
wais
'
,
'
imap
'
,
'
snews
'
,
...
[
'
ftp
'
,
'
hdl
'
,
'
prospero
'
,
'
http
'
,
'
imap
'
,
'
https
'
,
'
shttp
'
,
'
rtsp
'
,
...
[
'
http
'
,
'
wais
'
,
'
imap
'
,
'
https
'
,
'
shttp
'
,
'
mms
'
,
'
gopher
'
,
'
rtsp
'
,
...
[
'
ftp
'
,
'
hdl
'
,
'
http
'
,
'
gopher
'
,
'
news
'
,
'
nntp
'
,
'
wais
'
,
'
https
'
,
...
'
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-.
'
'''
http://a/b/c/d
g:h = <URL:g:h>
http:g = <URL:http://a/b/c/g>
http: = <URL:http://a/b/c/d>
g = <URL:http://a/b/c/g>
./g = <URL:http://a/b/c/g>
...
Trees | Indices | Help |
|
---|