Python自动化完成tb喵币任务V2.0
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                Python自动化完成tb喵币任务V2.0
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.                        
                                今天刷tb的喵幣發現竟然更改了按鈕名稱,不知道是不是淘寶檢測到了規律性的訪問還是。。。上有政策,下有對策,這次,我把全部坐標獲取出來,供選擇!這樣就可以不用進開發者模式找了。
import os,re import timedef go(x,y): for i in range(task):os.system('adb shell input tap {} {}'.format(x,y))#觸摸店鋪按鈕print('---開始任務---')time.sleep(4)os.system('adb shell input tap {} {}'.format(1,1))#模擬滑動界面print('---等待25秒---')time.sleep(25)print('---領取完成---')time.sleep(4)os.system('adb shell input keyevent 4')time.sleep(4)#os.system('adb shell input tap 518 2202')print('第{}任務領取完成'.format(i+1))print('______________________')def go_2():if os.path.exists('123.txt'):c=open('123.txt',encoding='UTF-8')a=c.read()e=re.findall('<node index="2" text="去瀏覽"(.*?)/>',a)#找到所有去瀏覽坐標 for i in e:g=re.search('\[(.*?)\]',i).group() print(g)print('以上是按照當前淘寶所有排序的“去瀏覽”按鈕,請根據排序填入要刷取的任務')print('---------------------------')else:try:os.system('adb shell uiautomator dump /sdcard/ui.xml')time.sleep(2)os.system('adb shell uiautomator dump /sdcard/ui.xml')os.system('adb pull /sdcard/ui.xml 123.txt')size=get_FileSize('123.txt') if size>=0.03:#第一次獲取ui會出現文件非淘寶xml c=open('123.txt',encoding='UTF-8')a=c.read()e=re.findall('<node index="2" text="去瀏覽"(.*?)/>',a)#找到所有去瀏覽坐標 for i in e:g=re.search('\[(.*?)\]',i).group()print(g)print('以下是按照當前淘寶所有排序的“去瀏覽”按鈕,請根據排序填入要刷取的任務')else:print('xml文件錯誤正在重新下載,請勿翻動手機界面')os.remove('123.txt')go_2()except:print('錯誤!正在回調函數')if os.path.exists('123.txt'):os.remove('123.txt')go_2() def get_FileSize(filePath): fsize = os.path.getsize(filePath)fsize = fsize/float(1024 * 1024) return round(fsize, 2)print('正在獲取頁面布局') print('----------------') go_2() print('author:劉秉哲') while 1:task=int(input('請輸入任務個數:'))x=int(input('請輸入任務X坐標:'))y=int(input('請輸入任務y坐標:')) go(x+20,y+20)還有10天就要結束了,希望有所幫助,可以節約寶貴時間。
總結
以上是生活随笔為你收集整理的Python自动化完成tb喵币任务V2.0的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: VFP获取微信小程序用户openID,易
- 下一篇: 关于日历点击跳转以及短信点击跳转到指定联
