This is a new module for python3. The urllib package serves as a namespace only. You might get error while using .parse if you don't import requests or parse

urllib is a package that collects several modules for working with URLs:

urllib.parse

quote() - url_encode

urllib.parse.quote(string, safe='/', encoding=None, errors=None)

Replace special characters in string using the %xx escape. Letters, digits, and the characters '_.- ~' are never quoted. By default, this function is intended for quoting the path section of a URL. The optional safe parameter specifies additional ASCII characters that should not be quoted - its default value is '/'.

Example: -

Untitled

quote_plus() - url_encode

urllib.parse.quote_plus(string, safe='', encoding=None, errors=None)

Like quote(), but also replace spaces with 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: -

Untitled

<aside> 💡 Similarly, urllib.parse.unquote(string, encoding='utf-8', errors='replace') and urllib.parse.unquote_plus(string, encoding='utf-8', errors='replace')

</aside>