一.今日做一个阿三的网址正好是个websocket要求

精粹都会这图上,和下边编码,没啥数据加密能够当个简易模版

总体目标网址url:https://m.jungleerummy.com/register

二.编码

import websocket
import json
url = 'wss://www.jungleerummy.com/ws'
headers= {
    'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1'
}
ws = websocket.create_connection(url=url,headers=headers, timeout=15)
print(ws.recv())
phone = 7406555536
data = {"type":"cm-registration-request","network":"JUNGLEERUMMY","username":"","password":"","email":phone,"userDeviceType":"mob","extra":{"adkey":"junglee","deviceInfo":{"deviceType":"mob"},"utmParams":{"utm_source":"","utm_medium":"","utm_campaign":"","utm_term":"","utm_content":"","gclid":"","fbclid":"","fbp":"","fbc":""},"referralId":0,"browserName":"Safari","browserVersion":"10","userAgentType":"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1","userAgent":"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1","otpTracking":{"pageUrl":"REGISTRATION","activity":"SIGNUP","otpMobileNo":"","resend":0,"mobile_number_detection_permission":"NO","mobile_number_capturing":"MANUAL","otp_capturing_permission":"NO","otp_capturing":"MANUAL"},"pageName":"/register","mobileNumber":phone,"registerWith":"MOBILEOTP"},"isBot":False}
ws.send(json.dumps(data))  # 以字符串数组推送信息
print(ws.recv())
ws.close()  # 关掉联接

三.填补知识要点

ws.send_frame("以帧方式发送数据")   # 以帧方式发送数据
ws.recv_data_frame()    # 接受以帧推送的数据信息
ws.send_binary("以二进制格式发送数据".encode())   # 以二进制格式发送数据
文章来源于网络 ,如有侵权请联系站长QQ61910465删除
本文版权归趣快排SEO www.SeogurUblog.com 所有,如有转发请注明来出,竞价开户托管,seo优化请联系QQ▶61910465