python clickZan

import pyautogui,time,random

pyautogui.PAUSE = 3
pyautogui.FAILSAFE = True

width, height = pyautogui.size()
#print(str(width))
#print(str(height))

def mouseScroll():
    time.sleep(5)
    for i in range(10):
        pyautogui.scroll(-200)
        time.sleep(2)

def getXy():
    try:
        while True:
            x, y = pyautogui.position()
            print(x,y)
    except KeyboardInterrupt:
        print('\nExit.')

def clickVideoAndComment(x,y):
    pyautogui.click(x,y)
    time.sleep(random.randint(5,15))
    pyautogui.scroll(-1000)
    pyautogui.scroll(-400)
    pyautogui.click(220,590)
    time.sleep(random.randint(1,3))
    pyautogui.typewrite('it is a good movie!')
    time.sleep(random.randint(1,3))
    pyautogui.click(839,630)
    pyautogui.click(710,16)
    pyautogui.click(860,300)
    
def xiguaClick():
    time.sleep(5)
    for i in range(200):
        print(str(i))
        time.sleep(random.randint(3,5))
        for p in range(4):
            print(str(p))
            pyautogui.click(188+200*p,188)
            time.sleep(random.randint(10,30))
            pyautogui.click(150,643) #点赞
            time.sleep(random.randint(5,20))
            pyautogui.click(470,15)
            time.sleep(random.randint(3,5))
        pyautogui.click(1030,560)
        pyautogui.scroll(-190) 


def haokanClick():
    time.sleep(5)
    for i in range(50):
        print(str(i))
        time.sleep(random.randint(3,5))
        for p in range(4):
            print(str(p))
            pyautogui.click(420+230*p,300)
            time.sleep(random.randint(5,15))
            pyautogui.scroll(-100)
            pyautogui.click(920,680) #点赞
            time.sleep(random.randint(3,10))
            pyautogui.click(470,15)
            time.sleep(random.randint(3,5))
        pyautogui.click(1300,360)
        pyautogui.scroll(-210)

def iqiyiClick():
    time.sleep(5)
    for i in range(50):
        print(str(i))
        time.sleep(random.randint(3,5))
        for p in range(4):
            print(str(p))
            pyautogui.click(560+188*p,220)
            time.sleep(random.randint(15,20))
            #pyautogui.scroll(-100)
            pyautogui.click(156,640) #点赞
            time.sleep(random.randint(3,10))
            pyautogui.click(470,15)
            time.sleep(random.randint(3,5))
        pyautogui.click(1300,360)
        pyautogui.scroll(-200)   

if __name__ == '__main__':
    str1 = input("输入标识 1、西瓜视频 2、好看视频 3、爱奇艺视频:")
    if str1 == "1":
        xiguaClick()
    elif str1=="2":
        haokanClick()
    elif str1=="3":
        iqiyiClick()
    else:
        time.sleep(5)
        pyautogui.scroll(-100)
   

  测试与14寸笔记本

posted @ 2020-02-16 09:12  凉城  阅读(182)  评论(0编辑  收藏  举报