request
1.官网地址:
https://requests.readthedocs.io/en/master/
2.
import requests r = requests.get("http://..........") # 将返回值转换为json格式 jsondata = r.json() # 判断数据长度 assert len(jsondata['data']) == 2 # data中所有"tab"的值都应为ask data = jsondata["data"] for d in data: assert d["tab"] == "ask"