1 Star 2 Fork 1

yanqiang/python爬虫记录

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
base64解密.py 1.59 KB
一键复制 编辑 原始数据 按行查看 历史
yanqiang 提交于 2021-02-20 15:17 . 提交文件
# -*- coding: utf-8 -*-
# @Time : 2020/8/7 13:46
# @Description:
# @Author : YanQiang
# @Email : 18988775754@163.com
# @File : base64解密.py
import base64
from datetime import datetime
import requests
a = 'aHR0cDovL3ljLndzd2oubmV0L2Foc3h4L0xPTC9wdWJsaWMvcHVibGljLmh0bWw='
res = base64.b64decode(a)
s = str(res, encoding="utf-8")
print(res)
print(s)
HEADERS = {
'Accept': 'application/json, text/javascript, */*; q=0.',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Origin': 'http://yc.wswj.net',
'Referer': 'http://yc.wswj.net/ahsxx/LOL/public/rain.html',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36'
}
def get_post(url):
data = {
'time': '',
'hourClass': '2.1LDEsMiwzLDYyMQ==',
'name': '2.1ZVNlbHRjYVJuaWFXbnJuSW9m',
'snsw': '2.1bnM=',
'waterEncode': '2.1cnRldQ==',
'random': '0.5908486321928954'
}
response = requests.post(url=url, data=data, headers=HEADERS)
print(response.text)
def get_time():
date = datetime.now()
timeStr = str(date).split(':')[0]
res = timeStr.split(' ')
if res[-1][0] == 0:
res2 = int(res[-1][-1]) + 1
else:
res2 = int(res[-1]) + 1
timeParam = res[0].replace("-","") + str(res2*100)
return timeParam
js_data = {
"name": "GetSwInfo",
"time": get_time(),
'fresh': 0,
"waterEncode": 'true'
}
if __name__ == '__main__':
url = 'http://61.191.22.196:5566/ahsxx/service/PublicBusinessHandler.ashx'
# get_post(url)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/yq1992/python-crawler-record.git
git@gitee.com:yq1992/python-crawler-record.git
yq1992
python-crawler-record
python爬虫记录
master

搜索帮助