url_exists

sunpy.util.net.url_exists(url, timeout=2)[source] [edit on github]

Checks whether a url is online.

Parameters:url (str) – A string containing a URL
Returns:value (bool)

Examples

>>> from sunpy.util.net import url_exists
>>> url_exists('http://www.google.com')  
True
>>> url_exists('http://aslkfjasdlfkjwerf.com')  
False