python物联网工具

2022-11-22 08:11:50 浏览数 (1)

代码、

代码语言:javascript复制
'''模仿真人登录网站'''
import json

import requests
from bs4 import BeautifulSoup
'''防止网站拦截码'''
headers={
    'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36',
    'Cookie':'Hm_lvt_a046ce178828e393614822a297b8d296=1665284221,1665396658,1667717795; JSESSIONID=C6E87ED65B89A735897061B9777FF804',
}
'''表单数据'''
from_zm={
    'username':'你的账号',
    'password':'嘿嘿',
}
url='http://5g.aioutx.com/pages/login.do'
resu=requests.post(url=url,headers=headers,data=from_zm)
'''编码 防止乱码'''
resu.encoding='utf-8'
'''解析网站'''
d=BeautifulSoup(resu.text,'lxml')
'''开通的套餐已经上架的'''
hes={
    'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36',
    'Cookie':'Hm_lvt_a046ce178828e393614822a297b8d296=1665284221,1665396658,1667717795; JSESSIONID=5D6FF0835ABA82B6FC6685263CDC6DE3',

}
sd={
    'menuId':'1041',
    'agentName':'',
    'type':'',
    'status':'1',
    'mealName':'',
    'category':'',
    'agentMobile':'',
    'mealSeriesName':'',
}
urls='http://5g.aioutx.com/agentsetmeal/grid.do?responseFunction=grid&pageSize=15&pageNo=1&rfm=0.2034181423443462'
sds=requests.post(url=urls,headers=hes,data=sd)
sds.encoding='utf-8'
s=json.loads(sds.text)

'''显示内容结果'''
count=0
'''解析数据'''
do=s['data']['rows']
for i in do:
    '''姓名'''
    name=i['agentName']
    '''用户名'''
    username=i['agentMobile']
    '''开通的流量包名称'''
    liu_names=i['name']
    '''价格'''
    money=i['agoMoney']
    '''套餐名'''
    money_name=i['typeStr']
    '''卡名称'''
    names_zh=i['categoryStr']
    '''当前状态'''
    names_zh_z=i['statusStr']
    '''我赚的利润百分比'''
    bai_chu=i['interestRate']
    '''成本价'''
    cheng=i['accountMoney']
    '''排序号'''
    xu_num=i['mealSort']
    '''总mb'''
    mb_num=i['flowSize']
    count=count 1
    print('----' * 20 '流量包数据' '----'*25)
    print(f"这是显示的第:{count}条数据结果开始")
    print(f"已经上架的流量包如下:n"
          f"对接的用户姓名:{name}n对接的用户名:{username}n流量包名称:{liu_names}n价格:{money}n套餐名:{money_name}n"
          f"卡名称:{names_zh}n当前状态:{names_zh_z}n我赚的百分比:{bai_chu}n"
          f"成本价:{cheng}n当前套餐序号:{xu_num}n总流量:{mb_num}MBn")
    print(f"这是显示的第:{count}条数据结果结束")
else:
    print(f"总共当前有:{count}条数据!")
    print('----'*65)
heads={
    'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36',
    'Cookie':'Hm_lvt_a046ce178828e393614822a297b8d296=1665284221,1665396658,1667717795; JSESSIONID=5D6FF0835ABA82B6FC6685263CDC6DE3',
}
ur='http://5g.aioutx.com/agentcardactivestatis/grid.do?responseFunction=agentcardactivestatis&pageSize=10&rfm=0.6302158634579531'
resusd=requests.post(url=ur,headers=heads)
resusd.encoding='utf-8'
r=json.loads(resusd.text)
'''解析数据'''
sd_to=r['data']['rows']
'''计数'''
shizhong_dai=0
for s in sd_to:
    '''代理商名称'''
    dai_names=s['agentName']
    '''代理用户名'''
    dai_username=s['agentAccount']
    '''卖出去的套餐'''
    dai_usermoney=s['wxMoneyStr']
    '''代理赚的钱百分比'''
    dai_bai=s['activedRateStr']
    '''创建代理商时间'''
    dai_times=s['createDateStr']
    shizhong_dai=shizhong_dai 1
    print('----' * 20 '客户代理数据' '----'*25)
    print(f"这是显示的第:{shizhong_dai}条数据结果开始")
    print(f"客户代理功能如下:n"
          f"代理商名称:{dai_names}n代理用户名:{dai_username}n当前卖出去的套餐金额:{dai_usermoney}n"
          f"代理赚的钱百分比:{dai_bai}n代理创建时间:{dai_times}n")
    print(f"这是显示的第:{shizhong_dai}条数据结果结束")
else:
    print(f"总共当前有:{shizhong_dai}条数据!")
    print('----'*65)
'''我的佣金体现记录'''
tixian_num=0
tixian={
    'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36',
    'Cookie':'Hm_lvt_a046ce178828e393614822a297b8d296=1665284221,1665396658,1667717795; JSESSIONID=C6E87ED65B89A735897061B9777FF804',
}
tixian_url='http://5g.aioutx.com/agentcommissiondrawapply/grid.do?responseFunction=grid&pageSize=15&pageNo=1&rfm=0.9066323104474201'
tianxian_reus=requests.post(url=tixian_url,headers=tixian)
tianxian_reus.encoding='utf-8'
tiaixn_shu=json.loads(tianxian_reus.text)
'''数据解析'''
tianxian_rows=tiaixn_shu['data']['rows']
for tx in tianxian_rows:
    '''提现订单号'''
    tx_number=tx['orderNumber']
    '''提现金额'''
    tx_number_num=tx['drawAmount']
    '''提现手续费'''
    tx_shouxu_num=tx['serviceFeeAmount']
    '''实际到账'''
    tx_shouxu_nums=tx['actualTransforAmount']
    '''提现姓名'''
    tx_names=tx['userName']
    '''提现手机号'''
    tx_phone=tx['alipayAccount']
    '''申请时间'''
    tx_times=tx['createDateStr']
    '''用户申请'''
    tx_shen=tx['recordTypeStr']
    '''处理时间'''
    tx_tixian=tx['handleDateStr']
    '''放款状态'''
    tx_fang_true=tx['drawStatusStr']
    '''到账app'''
    tx_zf=tx['recvMethodStr']
    tixian_num=tixian_num 1
    print('----' * 20 '佣金提现记录开始' '----'*25)
    print(f"这是显示的第:{tixian_num}条数据结果开始")
    print(f"佣金提现记录如下:n"
          f"提现单号:{tx_number}n提现金额:{tx_number_num}n提现手续费:{tx_shouxu_num}n"
          f"实际到账:{tx_shouxu_nums}n提现人姓名:{tx_names}n提现手机号:{tx_phone}n"
          f"申请提现时间:{tx_times}n用户申请:{tx_shen}n放款时间:{tx_tixian}n"
          f"放款状态:{tx_fang_true}n到账软件:{tx_zf}n")
    print('----' * 20   '佣金提现结束'   '----' * 25)
else:
    print(f"一共提现:{tixian_num}次")

0 人点赞