#coding=utf-8
import requests
from requests import Response

url='http://www.baidu.com'
#data={}

try:
    r=requests.get(url=url,params=None,timeout=30)
    r.raise_for_status()#如果状态不是200则引发异常
    r.encoding=r.apparent_enconding#配置编码
    print(r.text)
except:
    print( '请求异常')

3f47da97faae315c89f2a8e0009f1eb7b2ee6fe4
<mask token>

<mask token>
try:
    r = requests.get(url=url, params=None, timeout=30)
    r.raise_for_status()
    r.encoding = r.apparent_enconding
    print(r.text)
except:
    print('请求异常')

<mask token>
url = 'http://www.baidu.com'
try:
    r = requests.get(url=url, params=None, timeout=30)
    r.raise_for_status()
    r.encoding = r.apparent_enconding
    print(r.text)
except:
    print('请求异常')

import requests
from requests import Response
url = 'http://www.baidu.com'
try:
    r = requests.get(url=url, params=None, timeout=30)
    r.raise_for_status()
    r.encoding = r.apparent_enconding
    print(r.text)
except:
    print('请求异常')

#coding=utf-8
import requests
from requests import Response

url='http://www.baidu.com'
#data={}

try:
    r=requests.get(url=url,params=None,timeout=30)
    r.raise_for_status()#如果状态不是200则引发异常
    r.encoding=r.apparent_enconding#配置编码
    print(r.text)
except:
    print( '请求异常')
