代码拉取完成,页面将自动刷新
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 9 15:40:34 2022
@author: fengmingshan
"""
import requests
import time
import json
url = 'http://61.166.128.245:9001/subscribe/'
# 以字典的形式构造数据
district= ['锦林小区' for x in range(2000)]
firstName = ['欧阳' for x in range(2000)]
gender = ['先生' for x in range(2000)]
building = ['一栋' for x in range(2000)]
unit = ['一单元' for x in range(2000)]
floor = [1 for x in range(2000)]
room = ['1-1-201' for x in range(2000)]
subscribeDate = ['2022年10月1日 17点' for x in range(2000)]
telephone = ['13378749267' for x in range(2000)]
for d,f,g,b,u,fl,r,s,t in zip(
district,
firstName,
gender,
building,
unit,
floor,
room,
subscribeDate,
telephone,
):
data = {
'district': d,
'firstName': f,
'gender': g,
'building': b,
'unit': u,
'floor': fl,
'room': r,
'subscribeDate': s,
'telephone': t,
}
time.sleep(0.5)
# 与 get 请求一样,r 为响应对象
r = requests.post(url, data=json.dumps(data))
# 查看响应结果
print(r.json())
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。