python模拟app发送报文,python3 urllib 模拟登陆抓取app 数据

import urllib

import urllib.request

import http.cookiejar

loginURL = 'http://120.55.151.61:80/V2/StudentSkip/loginCheckV4.action'

ListURL = "http://120.55.151.61:80/Treehole/V4/Message/getListByType.action"

headers = {

'Content-Type':'application/x-www-form-urlencoded; charset=utf-8',

'User-Agent':'Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E216 -SuperFriday_9.4.0',

'Host':'120.55.151.61:80',

'Connection':"Keep-Alive",

'Accept-Encoding':'gzip',

'Content-Length':"285"

}

loginData = {"password":"fe14",

"account":"9edd",

"registrationId":"",

"ifa":"5606A9A6-",

"ifv":"F277A23",

"versionNumber":"9.4.0",

"platform":"2",

"channel":"AppStore",

"phoneVersion":"11.3",

"phoneModel":"iPhone%208",

"phoneBrand":"Apple"}

data = bytes(urllib.parse.urlencode(loginData), encoding='utf8')

cookieJar = http.cookiejar.CookieJar()

handler = urllib.request.HTTPCookieProcessor(cookieJar)

opener = urllib.request.build_opener(handler)

urllib.request.install_opener(opener)

data = urllib.request.urlopen(loginURL, data)

print(data.read())

requestData = {"type":1,

"timestamp":0,

"versionNumber":"9.4.0",

"platform":2,

"channel":"AppStore",

"phoneVersion":"11.3",

"phoneModel":"iPhone%208",

"phoneBrand":"Apple"}

byteData = bytes(urllib.parse.urlencode(requestData), encoding='utf8')

urllib.request.install_opener(opener)

data = urllib.request.urlopen(ListURL, byteData)

print(data.read())

Post Views: 1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值