import requests
requests.ConnectionError
request.HTTPError
requests.URLError
requests.URLRequired
requests.TooManyRedirects
requests.ConnectTimeout
requests.Timeout
r.raise_for_status
def getHTMLText(url): try: r = requests.get(url, timeout=30) r.raise_for_status() r.encoding = r.aparent_encoding