urllib.parse.urlsplit(urlstring, scheme='', allow_fragments=True)
This is similar to urlparse()
, but does not split the params from the URL. This should generally be used instead of urlparse()
if the more recent URL syntax allowing parameters to be applied to each segment of the path portion of the URL (see RFC 2396) is wanted. A separate function is needed to separate the path segments and parameters. This function returns a 5-tuple: (addressing scheme, network location, path, query, fragment identifier).
The return value is actually an instance of a subclass of tuple
. This class has the following additional read-only convenience attributes:
Attribute | Index | Value | Value if not present |
---|---|---|---|
scheme | 0 | URL scheme specifier | scheme parameter |
netloc | 1 | Network location part | empty string |
path | 2 | Hierarchical path | empty string |
query | 3 | Query component | empty string |
fragment | 4 | Fragment identifier | empty string |
username | User name | None | |
password | Password | None | |
hostname | Host name (lower case) | None | |
port | Port number as integer, if present | None |
See section Structured Parse Results for more information on the result object.
Please login to continue.