0 声明
此脚本只用于读者学习使用,禁止用于非法用途。
1 源码(python实现)
# JDAutoBuy
import os
from selenium import webdriver
import datetime
import time
from os import path
#将下面的路径替换为你电脑内chromedriver所在的路径
driver = webdriver.Chrome("C:\Program Files (x86)\Google\Chrome\Application\chromedriver")
def login():
driver.get("https://www.jd.com/")
if driver.find_element_by_class_name("link-login"):
driver.find_element_by_class_name("link-login").click()
print("请在15秒内完成扫码")
time.sleep(15)
driver.get("https://cart.jd.com/cart.action")
now = datetime.datetime.now()
print("login success:", now.strftime("%Y-%m-%d %H:%M:%S"))
def buy(buytime):
while True:
now = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
print(buytime)
print(now)
# 对比时间&#x