[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 评论