Validate URL

Check if a string is a valid URL.

Code

General
from urllib.parse import urlparse
result = urlparse(url)
return bool(result.scheme and result.netloc)

Parameters

The URL to validate

Server

More Python Snippets