urlstd.parse.parse_url#

urlstd.parse.parse_url(urlstring: str, base: str | URLRecord | None = None, encoding: str = 'utf-8', **kwargs) URLRecord#

Parses a string urlstring against a base URL base using the basic URL parser, and returns URLRecord.

Parameters:
  • urlstring – An absolute-URL or a relative-URL. If urlstring is a relative-URL, base is required.

  • base – An absolute-URL for a relative-URL urlstring.

  • encoding – The encoding to encode URL’s query. If the encoding fails, it will be replaced with the appropriate XML character reference.

Returns:

A URL record.

Raises:

urlstd.error.URLParseError – Raised when URL parsing fails.