goalie.is_existing_url

goalie.is_existing_url(x: object, timeout: float = 5.0) bool

Check whether the URL exists (is accessible).

Supports HTTPS, HTTP, and FTP protocols.

Parameters:
  • x (object) – URL to check.

  • timeout (float) – Timeout in seconds.

Returns:

True if a HEAD or GET request against x succeeds.

Return type:

bool

Examples

>>> is_existing_url("not-a-url")
False