Location

Overview

Location is a class in Aspose.HTML FOSS for Python.

The Location class mirrors the browser location object, allowing assign, replace, and reload of URLs and exposing href, protocol, host, pathname, search, and hash components.

This class declares 4 methods for Location objects in Python programs. Available methods include: __init__, assign, reload, replace. Public members are accessible to any Python application after installing the Aspose.HTML FOSS for Python package. Properties: hash, host, hostname, href, pathname, port, and 2 more.

Properties

NameTypeAccessDescription
hrefstrRead/WriteCurrent document URL string.
protocolstrRead/WriteGets or sets the protocol.
hoststrRead/WriteGets or sets the host.
hostnamestrRead/WriteGets or sets the hostname.
portstrRead/WriteGets or sets the port.
pathnamestrRead/WriteGets or sets the pathname.
searchstrRead/WriteGets or sets the search.
hashstrRead/WriteGets or sets the hash.

Methods

SignatureDescription
__init__(window: "Window")Calls init(window) on this Location instance.
assign(url: str)Push a same-document navigation-style history entry.
replace(url: str)Replace the current history entry URL in-memory.
reload()Compatibility stub for browser-style location.reload().

See Also