java中的接口是类吗
282
2022-11-05
如何使用pywinauto和pyautogui将动漫美女链接请回家
首先确定链接以字符串赋值给python变量
使用下面代码抓取链接
import redata=re.compile('nid=dt_[0-9]+').findall(url_data)data=["for i in data]# print()from pywinauto import Applicationfrom pywinauto import mouse import pyautogui import timeimport pyperclipchrome_dir="C:/Program Files/Google/Chrome/Application/chrome.exe"chrome = Application(backend='uia')for one in data: chrome.start(chrome_dir + ' --force-renderer-accessibility --incognito --start-maximized '+one,timeout=5) mouse.move(coords=(420, 420)) time.sleep(0.5) mouse.move(coords=(490, 490)) # mouse.double_click(button='left', coords=(200, 200)) # pyautogui.click(490,490,duration=0.5) pyautogui.press("F12") pyautogui.click(1520,300,duration=0.5) pyautogui.click(1520,500,duration=0.5) send_keys=""" document.querySelector("#app > div > div.app-module_contentWrapper_12u0y > div > div.app-module_leftSection_2GBVu > div.index-module_articleContainer_32gOp > div.index-module_contentContainer_3mQeg > div > div > div > div > div > div:nth-child(1) > div.index-module_img_2Y2y2.index-module_border-radius-tl_14YCd").click() """ pyperclip.copy(send_keys) pyautogui.hotkey('ctrl','v') pyautogui.press("enter") send_keys=""" (function(console){ console.save = function(data, filename){ if(!data) { console.error('Console.save: No data') return; } if(!filename) filename = 'console.json' if(typeof data === "object"){ data = JSON.stringify(data, undefined, 4) } var blob = new Blob([data], {type: 'text/json'}), e = document.createEvent('MouseEvents'), a = document.createElement('a') a.download = filename a.href = window.URL.createObjectURL(blob) a.dataset.downloadurl = ['text/json', a.download, a.href].join(':') e.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null) a.dispatchEvent(e) } })(console); var image_count=document.querySelector("#app > div > div.app-module_contentWrapper_12u0y > div > div.app-module_leftSection_2GBVu > div.index-module_articleContainer_32gOp > div.index-module_contentContainer_3mQeg > div > div > div > div > div > div > div").childElementCount; var turl="" for (i=4;i<=image_count;i++) {var url=document.querySelector("#app > div > div.app-module_contentWrapper_12u0y > div > div.app-module_leftSection_2GBVu > div.index-module_articleContainer_32gOp > div.index-module_contentContainer_3mQeg > div > div > div > div > div > div > div > div:nth-child("+i+") > img").getAttribute("src"); console.log(url); turl+="#####"+url;}; console.save(turl,"x.txt") """ pyperclip.copy(send_keys) pyautogui.hotkey('ctrl','v') pyautogui.press("enter") time.sleep(2)
最后合并下载文件 使用迅雷下载即可 上例源码和链接
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~