Python微信点赞
生活随笔
收集整理的這篇文章主要介紹了
Python微信点赞
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.png
2.png
?
3.png?
?4.png
?
?5.png
?6.png
import pyautogui #導入鼠標鍵盤庫 import time #進入微信 WX_location=pyautogui.locateCenterOnScreen('1.png',confidence=0.9) #查找精確度為1.0,即百分之百精準匹配——這其實很不方便,實際我們把精確度設為0.9更科學,既能保證不會找錯對象,又不會因為默認的精確度太苛刻,明明對象存在代碼卻找不到而返回None pyautogui.click(WX_location.x,WX_location.y,clicks=2,interval=0.1,duration=0.2,button="left")#點擊次數默認是1 while True:Logon_location=pyautogui.locateCenterOnScreen('2.png',confidence=0.9)if Logon_location is not None:pyautogui.click(Logon_location.x,Logon_location.y,clicks=1,interval=0.2,duration=0.2,button="left")#點擊次數默認是1breakprint("未找到匹配圖片,0.1秒后重試")time.sleep(0.1) #進入朋友圈 while True:Circle_location=pyautogui.locateCenterOnScreen('3.png',confidence=0.9)if Circle_location is not None:pyautogui.click(Circle_location.x,Circle_location.y,clicks=1,interval=0.2,duration=0.2,button="left")#點擊次數默認是1breakprint("未找到匹配圖片,0.1秒后重試")time.sleep(0.1) #進入點贊界面while True:Comment_location=pyautogui.locateCenterOnScreen('4.png',confidence=0.9)if Comment_location is not None:pyautogui.click(Comment_location.x,Comment_location.y,clicks=1,interval=0.2,duration=0.2,button="left")#點擊次數默認是1breakprint("未找到匹配圖片,0.1秒后重試")time.sleep(0.1) #點贊 roll = -100 while True:Like_location=pyautogui.locateCenterOnScreen('5.png',confidence=0.9)Liked_location=pyautogui.locateCenterOnScreen('6.png',confidence=0.9)if Liked_location is not None:while True:pyautogui.scroll(roll) # 向下滾動100Comment_location = pyautogui.locateCenterOnScreen('4.png', confidence=0.9)if Comment_location is not None:pyautogui.click(Comment_location.x, Comment_location.y, clicks=1, interval=0.2, duration=0.2,button="left")breakprint("未找到匹配圖片,0.1秒后重試")time.sleep(0.5)roll=roll-500elif Like_location is not None:pyautogui.click(Like_location.x, Like_location.y, clicks=1, interval=0.2, duration=0.2,button="left")else:while True:Comment_location = pyautogui.locateCenterOnScreen('4.png', confidence=0.9)if Comment_location is not None:pyautogui.click(Comment_location.x, Comment_location.y, clicks=1, interval=0.2, duration=0.2,button="left") # 點擊次數默認是1breakprint("未找到匹配圖片,0.1秒后重試")time.sleep(0.1)參考:
????????嗶哩嗶哩: up主? ?不開心就喝水? 的代碼
嗶哩嗶哩視頻鏈接
總結
以上是生活随笔為你收集整理的Python微信点赞的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Parsing error: No Ba
- 下一篇: python利用以下公式求π的值_Pyt