Python script to grab Moutai, the same can also be used to grab tickets

 The snapping assistant is an auxiliary scripting tool based on the Android system, which simulates manual clicking on the mobile phone screen to realize automatic operation. Convenient, fast, safe and non-toxic. Principles of snapping up software

When we click the buy button, we will send an HTTP request to the server of the platform. This HTTP request will carry your account information (token or cookie), product id, quantity, payment password, etc. and send it to the server. After the server receives the request, it will perform the snap-up operation, and then return the result, telling you whether the snap-up result is successful (successful snap-up, insufficient inventory, server exception...).
 

Code; from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
import datetime

#Ensure that the browser will not launch after the end of the run
option = webdriver.ChromeOptions()
option.add_experimental_option("detach", True)

# Create Chrome browser object
driver = webdriver.Chrome(options=option)

# Access page
driver.get("https://cart.taobao.com /")
# Maximize the browser window
driver.maximize_window()

title = ""
while not title == "Taobao-My Shopping Cart":
title = driver.title

time.sleep(1)

# while True :
if driver.find_element(By.ID,"J_SelectAll1"):
driver.find_element(By.ID,"J_SelectAll2").click()
# break#创建目标时间点
target_time = datetime.datetime(2023, 2, 23, 17, 36, 55)
while True:
now = datetime.datetime.now()
current_time = now.strftime('%H:%M:%S')
if now > target_time :
submit = driver.find_element(By.ID,"J_Go")
submit.click()
print("点击提交 :" + current_time)
break

おすすめ

転載: blog.csdn.net/q2919761440/article/details/131345262