练手写的python 淘宝购物车秒杀器 源码,成品链接,效果图

分享一款使用Python编写的淘宝购物车秒杀器,附带源码及成品下载链接,通过Chrome浏览器实现高效抢购。效果显著,帮助用户提高在淘宝秒杀活动中的成功率。
摘要由CSDN通过智能技术生成
#-*-coding:GBK -*- 
import os
import winreg #操作注册表
import re
import sys 
from tkinter import * 
from win32gui import *
import tkinter as tk
import tkinter.messagebox as msg
import win32gui,win32api,win32con
from selenium.webdriver.chrome.options import Options
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
from selenium.webdriver.support.ui import WebDriverWait
import requests
from datetime import datetime
import threading  #多线程
import configparser
from datetime import datetime, timedelta
import ctypes #隐藏控制台库
import shelve# 保存变量

def hideConsole(): #隐藏控制台
    """
    Hides the console window in GUI mode. Necessary for frozen application, because
    this application support both, command line processing AND GUI mode and theirfor
    cannot be run via pythonw.exe.
    """

    whnd = ctypes.windll.kernel32.GetConsoleWindow()
    if whnd != 0:
        ctypes.windll.user32.ShowWindow(whnd, 0)
        # if you wanted to close the handles...
        #ctypes.windll.kernel32.CloseHandle(whnd)
hideConsole()#隐藏控制台        
def key360(): #获取360浏览器位置
 UnInsKey360 = '360SeSESshellopencommand'
 key360 = winreg.OpenKey(winreg.HKEY_CLASSES_ROOT, UnInsKey360)
 name,value,type = winreg.EnumValue(key360,0) #注册表键名,键值,数据类型
 num = re.findall(r"(.+?)360se.exe",value)
 num = num[0]+'360se.exe'
 return(num)
def test(content):  #输入框内容限定为数字
    # 如果不加上==""的话,就会发现删不完。总会剩下一个数字
    if content.isdigit() or content == "":
        return True
    else:
        return False

def thread_it(func, *args):
    '''将函数打包进线程'''
    # 创建
    t = threading.Thread(target=func, args=args) 
    # 守护 !!!
    t.setDaemon(True) 
    # 启动
    t.start()
    # 阻塞--卡死界面!
    # t.join()

def time_server():
    # 获取淘宝服务器的时间戳
    r1 = requests.get(url='http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp',
                      headers={
                          'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/6.2.4098.3 Safari/537.36'}
                      ).json()['data']['t']
    # 把时间戳格式/1000 获取毫秒
    timeNum = int(r1) / 1000
    # 格式化时间 (小数点后6为)
    time1 = datetime.fromtimestamp(timeNum)
    return time1
def time_server1():
    # 获取淘宝服务器的时间戳
    r1 = requests.get(url='http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp',
                      headers={
                          'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/6.2.4098.3 Safari/537.36'}
    
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值