python抽卡游戏_【python爬虫】原神公测预抽卡活动自动化抽卡脚本

[Python] 纯文本查看 复制代码import requests

import json

class Crawl():

#初始化cookies

def __init__(self):

self.login_ticket = "";

self.account_id="";

self.login_uid="";

self.cookie_token="";

#get请求

def get(self,url):

payload = {}

headers = {

'Cookie': 'login_uid='+self.login_uid+'; account_id='+self.account_id+'; login_ticket='+self.login_ticket+'; cookie_token='+self.cookie_token,

}

response = requests.request("GET", url, headers=headers, data = payload)

return json.loads(response.text)

#post请求

def post(self,url,data):

headers = {

'Cookie': 'login_uid='+self.login_uid+'; account_id='+self.account_id+'; login_ticket='+self.login_ticket+'; cookie_token='+self.cookie_token

}

response = requests.request("POST", url, headers=headers, data = data)

return json.loads(response.text)

def post2(self,url):

headers = {

'Cookie': 'login_uid='+se

本文链接:https://my.lmcjl.com/post/19221.html

展开阅读全文

4 评论

留下您的评论.