根据网络接口请求数据:通过第三方库requests提供的方法
1.获取网络数据
response = requests.get('https://www.apiopen.top/satinApi?type=1&page=1')
print(response)
-
获取字符串形式的数据结果
text = response.text
-
获取二进制数据
data = response.content
-
获取json数据
msg = response.json()
response = requests.get('https://www.apiopen.top/satinApi?type=1&page=1')
print(response)
text = response.text
data = response.content
msg = response.json()