12345678910111213141516171819202122 |
- import json
- import requests
- import time
- url = "http://192.168.100.31:8179/score_list"
- with open("body.json") as f:
- data = json.loads(f.read())
- body = json.loads(data['data'])
- body['strategy'] = "ArticleRankV2"
- body['publishNum'] = 4
- # body['accountName'] = "指尖奇文"
- headers = {"Content-Type": "application/json"}
- a = time.time()
- response = requests.post(url=url, headers=headers, json=body)
- b = time.time()
- print(json.dumps(response.json(), ensure_ascii=False, indent=4))
- print(b - a)
- # for res in response.json()['data']['rank_list']:
- # print(res['title'], res['producePlanName'], res['score'], res['crawlerViewCount'])
|