-admin-login-aspx

今天在52学习到的,大佬A是在网易云音乐   歌单设置  里,过程没看到,封装一个exe了,可以控制本地cmd命令\

思路很奇特,想了一下感觉实现应该简单,就打算自己实现一下\

两步走;网页正则和本地os.system调用....

实现确实很简单,但是思路很奇特有没有

代码很low,主要学习思路学习思路

python版本3.X

from urllib import request
import io,sys,re,time
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding=\'gb18030\')
import os
import time
import subprocess
#https://www.cnblogs.com/-admin-login-aspx/

class Spider(): url_num = input(\'http://space.bilibili.com/*******:\') url = ("http://space.bilibili.com/"+url_num) #url=\'http://space.bilibili.com/19523178\' one_pattern = \'QAQ([\s\S]*?)QAQ\' #main_one_pattern = \'\' def fetch_content(self): r = request.urlopen(Spider.url) htmls = r.read() htmls = str(htmls,encoding=\'utf-8\') #print (htmls) return htmls def analysis(self,htmls): one_html = re.findall(Spider.one_pattern,htmls) # print (one_html) one_html=one_html[0] return one_html def local_cmd(self,one_html): os.system(one_html) #os.system(r\'taskkill /F /IM YoudaoNote.exe\') print(\'ok!\') def loop_cmd(self): while 1: time.sleep(1) htmls = self.fetch_content() self.local_cmd(self.analysis(htmls)) def main(self): self.loop_cmd() spider = Spider() spider.main()#https://www.cnblogs.com/-admin-login-aspx/

代码放github上

分类:

技术点:

相关文章: