前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >python物联网工具

python物联网工具

作者头像
刘鸿运
发布2022-11-22 08:11:50
3860
发布2022-11-22 08:11:50
举报
文章被收录于专栏:奋斗少年

代码、

代码语言: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}MB\n")
    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}次")
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022-11-20,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
物联网
腾讯连连是腾讯云物联网全新商业品牌,它涵盖一站式物联网平台 IoT Explorer,连连官方微信小程序和配套的小程序 SDK、插件和开源 App,并整合腾讯云内优势产品能力,如大数据、音视频、AI等。同时,它打通腾讯系 C 端内容资源,如QQ音乐、微信支付、微保、微众银行、医疗健康等生态应用入口。提供覆盖“云-管-边-端”的物联网基础设施,面向“消费物联”和 “产业物联”两大赛道提供全方位的物联网产品和解决方案,助力企业高效实现数字化转型。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档