标签:encoding coding _for text http import requests pre blog
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
标签:encoding coding _for text http import requests pre blog
原文地址:http://www.cnblogs.com/jinggo/p/7720165.html