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"

 

posted @ 2023-03-10 10:07  *球球*  阅读(27)  评论(0编辑  收藏  举报