Use Python to implement a simple website plug-in

The function is very simple. Click the mouse on the website according to a fixed rule. The Python technology involved is as follows:

import win32api
import win32con
import win32gui
from ctypes import *
import time
import sys

windll.user32.SetCursorPos(830,375)
time.sleep(0.01)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
time.sleep(0.01)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
time.sleep(1.2)

That is, move the mouse to the specified position, click the mouse, and release the mouse.

Open the webpage and put it on top, find the coordinates of the position you want to click, and write them in the code in turn. After clicking, the webpage will switch, and you should leave enough time for the new webpage to load.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324786476&siteId=291194637