```python # @Author : Kenvie # @Time : 2022/8/27 19:28 # @File : main.py import requests # 这里填入本次登陆的formhash,如 0fde7443,引号保留 formhash = '' # 此处填写cookie Cookie = '' def main(): headers = { 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3', 'accept-encoding': 'gzip, deflate, br', 'accept-language': 'h-CN,zh;q=0.9, br', 'cache-control': 'max-age=0', 'Cookie': Cookie, 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36' } a = requests.session().get( 'https://替换域名/plugin.php?id=dsu_amupper&ppersubmit=true&formhash=' + formhash + '&infloat=yes&handlekey=dsu_amupper&inajax=1&ajaxtarget=fwin_content_dsu_amupper', headers=headers) b = a.text print(b) print("######################################################") if "非法" in b: print("论坛Cookie失效") elif "已签到" in b: print("论坛已手动签到") elif "累计签到" in b: print("论坛签到成功") else: print("论坛签到失败") if __name__ == '__main__': main() ``` Loading... ```python # @Author : Kenvie # @Time : 2022/8/27 19:28 # @File : main.py import requests # 这里填入本次登陆的formhash,如 0fde7443,引号保留 formhash = '' # 此处填写cookie Cookie = '' def main(): headers = { 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3', 'accept-encoding': 'gzip, deflate, br', 'accept-language': 'h-CN,zh;q=0.9, br', 'cache-control': 'max-age=0', 'Cookie': Cookie, 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36' } a = requests.session().get( 'https://替换域名/plugin.php?id=dsu_amupper&ppersubmit=true&formhash=' + formhash + '&infloat=yes&handlekey=dsu_amupper&inajax=1&ajaxtarget=fwin_content_dsu_amupper', headers=headers) b = a.text print(b) print("######################################################") if "非法" in b: print("论坛Cookie失效") elif "已签到" in b: print("论坛已手动签到") elif "累计签到" in b: print("论坛签到成功") else: print("论坛签到失败") if __name__ == '__main__': main() ``` 最后修改:2022 年 08 月 31 日 © 允许规范转载 打赏 赞赏作者 赞 28 如果觉得我的文章对你有用,请随意赞赏
3 条评论
谢谢分享,写的不错