宪法课堂一键签到脚本 – Python版

高校下发任务,由于小程序bug,操作巨麻烦,视频又多,打卡不方便。为了更好的给学校增加打卡人数(造福偷懒),遂写脚本一个自动化完成,坐等一分钟即可打卡120个视频任务。 pythonimport requests '''使用说明''' # 电脑登录 http://static.qspfw.com/xf2019/index.html # 第一步,右键,选择检查,右侧选中 network,此时刷新网页,点击右侧,点击XHR,按下CTRL+C,输入 TGT.*?; 并回车。 # 第二步,在右侧 cookie 中,复制 access_token 等号后面到第一个分号中间的内容,替换Python中的 mytoken # 第三步,运行,坐等 1 分钟 mytoken = "TGT-715849-9zdfPEw94rH7dL1VkP3N2CsCf2avNMsrmPOu0ozTxmOfGypEr-cas.qspfw.com" obj = ['97045018652462261' ,'97045018652462262' ,'97045018652462263' ,'97045018652462264' ,'97045018652462265' ,'97045018652462266' ,'97045018652462267' ,'97045018652462268' ,'97045018652462269' ,'97045018652462270' ,'97045018652462271' ,'97045018652462272' ,'97045018652462273' ,'97045018652462274' ,'97045018652462275' ,'97045018652462276' ,'97045018652462277' ,'97045018652462278' ,'97045018652462279' ,'97045018652462280' ,'97045018652462281' ,'97045018652462282' ,'97045018652462283' ,'97045018652462284' ,'97045018652462285' ,'97045018652462286' ,'97045018652462287' ,'97045018652462288' ,'97045018652462289' ,'97045018652462290' ,'97045018652462291' ,'97045018652462292' ,'97045018652462293' ,'97045018652462294' ,'97045018652462295' ,'97045018652462296' ,'97045018652462297' ,'97045018652462298' ,'97045018652462299' ,'97045018652462300' ,'97045018652462301' ,'97045018652462302' ,'97045018652462303' ,'97045018652462304' ,'97045018652462305' ,'97045018652462306' ,'97045018652462307' ,'97045018652462308' ,'97045018652462309' ,'97045018652462310' ,'97045018652462311' ,'97045018652462312' ,'97045018652462313' ,'97045018652462314' ,'97045018652462315' ,'97045018652462316' ,'97045018652462317' ,'97045018652462318' ,'97045018652462319' ,'97045018652462320' ,'97045018652462321' ,'97045018652462322' ,'97045018652462323' ,'97045018652462324' ,'97045018652462325' ,'97045018652462326' ,'97045018652462327' ,'97045018652462328' ,'97045018652462329' ,'97045018652462330' ,'97045018652462331' ,'97045018652462332' ,'97045018652462333' ,'97045018652462334' ,'97045018652462335' ,'97045018652462336' ,'97045018652462337' ,'97045018652462338' ,'97045018652462339' ,'97045018652462340' ,'97045018652462341' ,'97045018652462342' ,'97045018652462343' ,'97045018652462344' ,'97045018652462345' ,'97045018652462346' ,'97045018652462347' ,'97045018652462348' ,'97045018652462349' ,'97045018652462350' ,'97045018652462351' ,'97045018652462352' ,'97045018652462353' ,'97045018652462354' ,'97045018652462355' ,'97045018652462356' ,'97045018652462357' ,'97045018652462358' ,'97045018652462359' ,'97045018652462360' ,'97045018652462361' ,'97045018652462362' ,'97045018652462363' ,'97045018652462364' ,'97045018652462365' ,'97045018652462366' ,'97045018652462367' ,'97045018652462368' ,'97045018652462369' ,'97045018652462370' ,'97045018652462371' ,'97045018652462372' ,'97045018652462373' ,'97045018652462374' ,'97045018652462375' ,'97045018652462376' ,'97045018652462377' ,'97045018652462378' ,'97045018652462379' ,'97045018652462380' ,'97045018652462381'] api_url…

Python海龟绘图画五星红旗

今天是中华人民共和国成立70周年纪念日。70周年大会于今日举行,习大大在天安门发表了重要讲话,阅兵场面非常壮观威武有排面。见了那么多朋友圈里各种花里胡哨的祝福,来看看这份特殊的用Python画的五星红旗吧。 测试版本:Python3.7,使用海龟绘图。 pythonimport turtle turtle.speed(10) # 红色的旗面 def qimian(x, y, color): turtle.up() turtle.goto(x, y) turtle.down() turtle.color(color) turtle.begin_fill() for i in range(1, 5): if i % 2 == 0: turtle.forward(205) else: turtle.forward(285) turtle.left(90) turtle.end_fill() # 黄色的五角星(大) def wujiaoxing(x, y, color): turtle.up() turtle.goto(x, y) turtle.down() turtle.color(color) turtle.begin_fill() for i in range(5): turtle.forward(30) turtle.right(144) turtle.end_fill() # 四个小五角星 def xiaowujiao(x, y, single): turtle.up() turtle.goto(x, y) turtle.left(single) turtle.down() turtle.color("yellow") turtle.begin_fill() for i in range(5): turtle.forward(12) turtle.right(144) turtle.end_fill() qimian(-110, -90, "red") wujiaoxing(-85, 55, "yellow") xiaowujiao(-35, 80, 30) xiaowujiao(-14, 55, 60) xiaowujiao(-12, 28, 30) xiaowujiao(-22, 10, 60) turtle.up() turtle.goto(-110,-90) turtle.write("祖国爸爸70周年快乐", font=("Arial",18, "bold")) turtle.hideturtle() turtle.done() 复制123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354import turtle turtle.speed(10) # 红色的旗面 def qimian(x, y, color):     turtle.up()     turtle.goto(x, y)     turtle.down()     turtle.color(color)     turtle.begin_fill()     for i in range(1, 5):         if i % 2 == 0:             turtle.forward(205)        …

简单教程 8位QQ靓号爬取并过滤 – Python版

最近主Q由于各种原因,被腾讯搞了个永久冻结,无奈之下只好重新申请QQ,看到官网有靓号可以买断,恰逢刚学python入门,写了一个爬虫快速把8位靓号全部抓取,并通过脚本过滤掉不喜欢的数字,买断喜欢的号码。靓号官网:https://haoma.qq.com/act/index.html 打开浏览器,进入8位号码筛选网页,通过谷歌浏览器的开发者工具,找出js像后端发送请求的API链接: 打开py,开始搞定他吧。 pythonimport requests import re api="https://hm.vip.qq.com/cgi-bin/HaomaSearch.fcgi?cmd=Search&remoteplace=haoma.search.mobile2&random=0.015671382120121313&g_tk=1010290319&callback=searchResult&perpage=16&actid=30003&loginUin=712942401&sid=&fill=0&uin=712942401&page=" #转换页数 def page(p): return "&page=" + str(p) go = True mpage = 1 while go: r = requests.get(api + page(mpage)).text #正则表达式匹配数据中的qq号,放在数组中 pattern = re.compile(r'num":"(.*?)"') child = pattern.findall(r) #判断是否到最后一页 if len(child) > 0 : go = True mpage = mpage + 1 else: go = False mpage = 1 #循环输出 for i in range(0,len(child)): #去掉带有4 和 7 的号码 if ("4" not in child[i]) and ("7" not in child[i]): print(child[i]) 复制1234567891011121314151617181920212223242526272829import requests import re api="https://hm.vip.qq.com/cgi-bin/HaomaSearch.fcgi?cmd=Search&remoteplace=haoma.search.mobile2&random=0.015671382120121313&g_tk=1010290319&callback=searchResult&perpage=16&actid=30003&loginUin=712942401&sid=&fill=0&uin=712942401&page=" #转换页数 def page(p):     return "&page=" + str(p) go = True mpage = 1 while go:     r = requests.get(api  + page(mpage)).text     #正则表达式匹配数据中的qq号,放在数组中     pattern = re.compile(r'num":"(.*?)"')     child = pattern.findall(r)     #判断是否到最后一页     if len(child) > 0 :         go = True         mpage = mpage + 1     else:      …

Python中webbrowser的常用用法

纯属业余,如有错误多多指正。部分资料参考CSDN的一些博主。对于玩儿py来说,webbrowser模块相信大家都很熟悉,话不多说先看webbrowser.py的源代码