ID EN
Urllib Parse

geturl

Python 3.11

Return the re-combined version of the original URL as a string. This may differ from the original URL in that the scheme may be normalized to lower case and empty components may be dropped. Specifically, empty parameters, queries, and fragment identifiers will be removed.

Syntax

PYTHON
urllib.parse.SplitResult.geturl()

Examples

Example 1
PYTHON
>>> from urllib.parse import urlsplit
>>> url = 'HTTP://www.Python.org/doc/'
>>> r1 = urlsplit(url)
>>> r1.geturl()
'http://www.Python.org/doc/'
>>> r2 = urlsplit(r1.geturl())
>>> r2.geturl()
'http://www.Python.org/doc/'

See Also

urldefrag() urlsplit() urlparse()