提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
每天日检日报,有很多时候就会忘了,刚好以练习为目的,通过CSDN上的文章写了一个由MAC系统怎么做,一个简单的自动打卡脚本(虽然经常会忘记打卡但我也要认真对待日检日报)
Charles用途的内容可参考CSDN博主「会飞的咕咕鱼」
原文链接:https://blog.csdn.net/weixin_38659265/article/details/118961515
下载链接:https://www.charlesproxy.com/latest-release/download.do (选择macOS下载)
点Help中的SLL Rroxying中的Install Charles Root Certificate
将钥匙串选项更改为系统
点击查看证书并将使用此证书时改为始终信任
回到主页面点击Proxy 中的 SSL Proxying Settings…
在add中输入*.*点击OK返回主页
点击红色的开始按钮 , 随便打开一个网页就会有一下场景,说明环境配置完毕
模拟登录微信,打开需要打卡的网页获取token
Python安装可参考CSDN链接:https://blog.csdn.net/kj7762/article/details/119904567
Pycharm安装可参考CSDN链接:https://blog.csdn.net/kj7762/article/details/119904643
代码如下(示例):
import requests
import datetime
import time
class Auto:
def __init__(self):
self.token_array = [""] # 双引号里面填获取到的token
self.url = "https://student.wozaixiaoyuan.com/health/save.json"
self.headers = {
"Host": "student.wozaixiaoyuan.com",
"Connection": "keep-alive",
"Content-Length": "310",
"User-Agent": "Mozilla/5.0 (Windows NT 6.1 WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36 MicroMessenger/7.0.9.501NetType/WIFI MiniProgramEnv/Windows WindowsWechat",
"content-type": "application/x-www-form-urlencoded",
"token": "",
"Referer": "https://servicewechat.com/wxce6d08f781975d91/158/page-frame.html",
"Accept-Encoding": "gzip, deflate, br",
}
self.data = {
"answers": '["0"]',
"latitude": "XX.1145XX",
"longitude": "XXX.031847",
"country": "中国",
"city": "xx市",
"district": "xx县",
"province": "xx省",
"township": "xx街道",
"street": "xx路",
"areacode": "xxxx24",
}
def run(self):
for token in self.token_array:
self.headers["token"] = token
print("token is: " + self.headers["token"])
print(datetime.datetime.now())
response = requests.post(
self.url, data=self.data, headers=self.headers)
if response.status_code == 200:
print("success")
print(response.content.decode())
else:
print(response.status_code)
if __name__ == "__main__":
Auto().run()
代码内容参考CSDN博主 原文链接:https://blog.csdn.net/qq_43826212/article/details/113105207
链接:https://cloud.tencent.com/login?s_url=https%3A%2F%2Fconsole.cloud.tencent.com%2Fscf%2Flist
第一次写博客,还有很多不足的地方, 中间有很多不熟悉的内容都是参考别的博主, 在编写的时候也是屡屡出错,但好在最后顺利的完成了人生第一篇博客(由于目前token值会隔段时间就更新,登录状态也需要频繁的更改,所以大家还是要坚持每日打卡哦)