urllib.parse.urldefrag()

urllib.parse.urldefrag(url) If url contains a fragment identifier, return a modified version of url with no fragment identifier, and the fragment identifier as a separate string. If there is no fragment identifier in url, return url unmodified and an empty string. 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 url 0 URL with no fragment empty string fragment

urllib.parse.unquote()

urllib.parse.unquote(string, encoding='utf-8', errors='replace') Replace %xx escapes by their single-character equivalent. The optional encoding and errors parameters specify how to decode percent-encoded sequences into Unicode characters, as accepted by the bytes.decode() method. string must be a str. encoding defaults to 'utf-8'. errors defaults to 'replace', meaning invalid sequences are replaced by a placeholder character. Example: unquote('/El%20Ni%C3%B1o/') yields '/El Niño/'.

urllib.parse.quote_plus()

urllib.parse.quote_plus(string, safe='', encoding=None, errors=None) Like quote(), but also replace spaces by plus signs, as required for quoting HTML form values when building up a query string to go into a URL. Plus signs in the original string are escaped unless they are included in safe. It also does not have safe default to '/'. Example: quote_plus('/El Niño/') yields '%2FEl+Ni%C3%B1o%2F'.

urllib.parse.unquote_to_bytes()

urllib.parse.unquote_to_bytes(string) Replace %xx escapes by their single-octet equivalent, and return a bytes object. string may be either a str or a bytes. If it is a str, unescaped non-ASCII characters in string are encoded into UTF-8 bytes. Example: unquote_to_bytes('a%26%EF') yields b'a&\xef'.

urllib.parse.SplitResult

class urllib.parse.SplitResult(scheme, netloc, path, query, fragment) Concrete class for urlsplit() results containing str data. The encode() method returns a SplitResultBytes instance.

urllib.parse.unquote_plus()

urllib.parse.unquote_plus(string, encoding='utf-8', errors='replace') Like unquote(), but also replace plus signs by spaces, as required for unquoting HTML form values. string must be a str. Example: unquote_plus('/El+Ni%C3%B1o/') yields '/El Niño/'.

urllib.parse.SplitResultBytes

class urllib.parse.SplitResultBytes(scheme, netloc, path, query, fragment) Concrete class for urlsplit() results containing bytes data. The decode() method returns a SplitResult instance. New in version 3.2.

urllib.parse.quote_from_bytes()

urllib.parse.quote_from_bytes(bytes, safe='/') Like quote(), but accepts a bytes object rather than a str, and does not perform string-to-bytes encoding. Example: quote_from_bytes(b'a&\xef') yields 'a%26%EF'.

urllib.parse.parse_qs()

urllib.parse.parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace') Parse a query string given as a string argument (data of type application/x-www-form-urlencoded). Data are returned as a dictionary. The dictionary keys are the unique query variable names and the values are lists of values for each name. The optional argument keep_blank_values is a flag indicating whether blank values in percent-encoded queries should be treated as blank strings. A t

urllib.parse.parse_qsl()

urllib.parse.parse_qsl(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace') Parse a query string given as a string argument (data of type application/x-www-form-urlencoded). Data are returned as a list of name, value pairs. The optional argument keep_blank_values is a flag indicating whether blank values in percent-encoded queries should be treated as blank strings. A true value indicates that blanks should be retained as blank strings. The default false val