├── .idea
├── inspectionProfiles
│ └── Project_Default.xml
├── misc.xml
├── modules.xml
├── taobao_seckill.iml
├── vcs.xml
└── workspace.xml
├── README.md
├── icon
└── 01.jpeg
├── main.py
├── requirements.txt
├── seckill
├── __pycache__
│ ├── seckill_taobao.cpython-37.pyc
│ └── settings.cpython-37.pyc
├── seckill_taobao.py
├── settings.py
└── useragents.txt
└── utils
├── __pycache__
└── utils.cpython-37.pyc
└── utils.py
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/taobao_seckill.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | true
55 |
56 | true
57 | true
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 | 1609233045053
149 |
150 |
151 | 1609233045053
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # taobao_seckill
2 | 淘宝、天猫半价抢购,抢电视、抢茅台,干死黄牛党
3 | ## 依赖
4 | ### 安装chrome浏览器,根据浏览器的版本找到对应的[chromedriver](http://npm.taobao.org/mirrors/chromedriver/)
5 |
6 | ## 使用说明
7 | 1、抢购前需要校准本地时间,然后把需要抢购的商品加入购物车
8 | 2、如果要打包成可执行文件,可使用pyinstaller自行打包
9 | 3、不需要打包的,直接在项目根目录下 执行 python3 main.py
10 | 4、程序运行后,会打开淘宝登陆页,需要自己手动点击切换到扫码登陆
11 |
12 | ## 淘宝有针对selenium的检测,如果遇到验证码说明被反爬了,此时应该放弃挣扎,凡是用到selenium的都会严重依赖网速、电脑配置。
13 |
--------------------------------------------------------------------------------
/icon/01.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/8090shuo/taobao_seckill/899b22851460795e6fd315493dd6b03ffc70b074/icon/01.jpeg
--------------------------------------------------------------------------------
/main.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 | __author__ = 'Jerry'
4 | from tkinter import *
5 | from seckill.seckill_taobao import ChromeDrive
6 |
7 |
8 |
9 | def run_killer(txt, txt2):
10 | seckill_time = txt.get()
11 | password = str(txt2.get())
12 | print(seckill_time, password)
13 | ChromeDrive(seckill_time = seckill_time, password = password).sec_kill()
14 |
15 |
16 |
17 | def main():
18 | win = Tk()
19 | win.title('小熊秒杀助手')
20 | width = 380
21 | height = 300
22 | screenwidth = win.winfo_screenwidth()
23 | screenheight = win.winfo_screenheight()
24 | alignstr = '%dx%d+%d+%d' % (width, height, (screenwidth - width) / 2, (screenheight - height) / 2)
25 | win.geometry(alignstr)
26 |
27 | lbl = Label(win, text = "开抢时间:", width = 8, height = 2)
28 | lbl.grid(column = 0, row = 0)
29 | txt = Entry(win, width = 18)
30 | txt.grid(column = 1, row = 0)
31 |
32 | lbl2 = Label(win, text = "支付密码:", width = 8, height = 2)
33 | lbl2.grid(column = 0, row = 1)
34 | txt2 = Entry(win, width = 18)
35 | txt2.grid(column = 1, row = 1)
36 |
37 | b1 = Button(win, text = '开始', command = lambda: run_killer(txt, txt2))
38 | b1.config(font = 'Helvetica -10 bold', bg = 'red', relief = 'sunken', width = 8, height = 6)
39 | b1.place(x=300, y=5)
40 | win.resizable(width = False, height = False)
41 |
42 | txt0 = Label(win, text = '使用说明:',width = 8, height = 2)
43 | txt0.grid(column = 0, row = 3)
44 |
45 | txt3 = Label(win, text = '1、安装chrome浏览器以及chromeDriver')
46 | txt3.config(font = 'Helvetica -10 bold', fg = 'red')
47 | txt3.place(x = 10, y = 120)
48 |
49 | txt4 = Label(win, text = '2、抢购前要清空购物车,然后把要抢的东西加入购物车')
50 | txt4.config(font = 'Helvetica -10 bold', fg = 'red')
51 | txt4.place(x = 10, y = 140)
52 |
53 | txt5 = Label(win, text = '3、开抢时间必须是 %Y-%m-%d %H:%M:%S 形式,如2020-12-29 12:10:15' )
54 | txt5.config(font = 'Helvetica -10 bold', fg = 'red')
55 | txt5.place(x=10, y=160)
56 |
57 | txt6 = Label(win, text = '4、输入开抢时间和支付密码后点开始,程序会控制浏览器打开淘宝登陆页')
58 | txt6.config(font = 'Helvetica -10 bold', fg = 'red')
59 | txt6.place(x = 10, y = 180)
60 |
61 | txt7 = Label(win, text = '5、扫码登陆后,程序会自动刷新购物车页面,到点会完成抢购动作')
62 | txt7.config(font = 'Helvetica -10 bold', fg = 'red')
63 | txt7.place(x = 10, y = 200)
64 |
65 | txt8 = Label(win, text = '6、本项目仅供交流学习使用,请勿用于其它任何商业用途')
66 | txt8.config(font = 'Helvetica -10 bold', fg = 'red')
67 | txt8.place(x = 10, y = 220)
68 | win.mainloop()
69 |
70 |
71 | if __name__ == '__main__':
72 | main()
73 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | selenium==3.141.0
2 |
--------------------------------------------------------------------------------
/seckill/__pycache__/seckill_taobao.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/8090shuo/taobao_seckill/899b22851460795e6fd315493dd6b03ffc70b074/seckill/__pycache__/seckill_taobao.cpython-37.pyc
--------------------------------------------------------------------------------
/seckill/__pycache__/settings.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/8090shuo/taobao_seckill/899b22851460795e6fd315493dd6b03ffc70b074/seckill/__pycache__/settings.cpython-37.pyc
--------------------------------------------------------------------------------
/seckill/seckill_taobao.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # encoding=utf-8
3 |
4 |
5 | import os
6 | import platform
7 | from time import sleep
8 | from random import choice
9 | from datetime import datetime
10 |
11 | from selenium import webdriver
12 | from selenium.common.exceptions import WebDriverException
13 |
14 | import seckill.settings as utils_settings
15 | from utils.utils import get_useragent_data
16 |
17 | from selenium.webdriver.common.by import By
18 | from selenium.webdriver.support.ui import WebDriverWait
19 | from selenium.webdriver.support import expected_conditions as EC
20 |
21 |
22 |
23 | # 抢购失败最大次数
24 | max_retry_count = 30
25 |
26 |
27 | def default_chrome_path():
28 |
29 | driver_dir = getattr(utils_settings, "DRIVER_DIR", None)
30 | if platform.system() == "Windows":
31 | if driver_dir:
32 | return os.path.abspath(os.path.join(driver_dir, "chromedriver.exe"))
33 |
34 | raise Exception("The chromedriver drive path attribute is not found.")
35 | else:
36 | if driver_dir:
37 | return os.path.abspath(os.path.join(driver_dir, "chromedriver"))
38 |
39 | raise Exception("The chromedriver drive path attribute is not found.")
40 |
41 |
42 |
43 | class ChromeDrive:
44 |
45 | def __init__(self, chrome_path=default_chrome_path(), seckill_time=None, password=None):
46 | self.chrome_path = chrome_path
47 | self.seckill_time = seckill_time
48 | self.seckill_time_obj = datetime.strptime(self.seckill_time, '%Y-%m-%d %H:%M:%S')
49 | self.password = password
50 |
51 | def start_driver(self):
52 | try:
53 | driver = self.find_chromedriver()
54 | except WebDriverException:
55 | print("Unable to find chromedriver, Please check the drive path.")
56 | else:
57 | return driver
58 |
59 | def find_chromedriver(self):
60 | try:
61 | driver = webdriver.Chrome()
62 |
63 | except WebDriverException:
64 | try:
65 | driver = webdriver.Chrome(executable_path=self.chrome_path, chrome_options=self.build_chrome_options())
66 |
67 | except WebDriverException:
68 | raise
69 | return driver
70 |
71 | def build_chrome_options(self):
72 | """配置启动项"""
73 | chrome_options = webdriver.ChromeOptions()
74 | chrome_options.accept_untrusted_certs = True
75 | chrome_options.assume_untrusted_cert_issuer = True
76 | arguments = ['--no-sandbox', '--disable-impl-side-painting', '--disable-setuid-sandbox', '--disable-seccomp-filter-sandbox',
77 | '--disable-breakpad', '--disable-client-side-phishing-detection', '--disable-cast',
78 | '--disable-cast-streaming-hw-encoding', '--disable-cloud-import', '--disable-popup-blocking',
79 | '--ignore-certificate-errors', '--disable-session-crashed-bubble', '--disable-ipv6',
80 | '--allow-http-screen-capture', '--start-maximized']
81 | for arg in arguments:
82 | chrome_options.add_argument(arg)
83 | chrome_options.add_argument(f'--user-agent={choice(get_useragent_data())}')
84 | return chrome_options
85 |
86 | def _login(self, login_url: str="https://www.taobao.com"):
87 | if login_url:
88 | self.driver = self.start_driver()
89 | else:
90 | print("Please input the login url.")
91 | raise Exception("Please input the login url.")
92 |
93 |
94 | while True:
95 | self.driver.get(login_url)
96 | try:
97 | if self.driver.find_element_by_link_text("亲,请登录"):
98 | print("没登录,开始点击登录按钮...")
99 | self.driver.find_element_by_link_text("亲,请登录").click()
100 | print("请在30s内扫码登陆!!")
101 | sleep(30)
102 | if self.driver.find_element_by_xpath('//*[@id="J_SiteNavMytaobao"]/div[1]/a/span'):
103 | print("登陆成功")
104 | break
105 | else:
106 | print("登陆失败, 刷新重试, 请尽快登陆!!!")
107 | continue
108 | except Exception as e:
109 | print(str(e))
110 | continue
111 |
112 | def keep_wait(self):
113 | self._login()
114 | print("等待到点抢购...")
115 | while True:
116 | current_time = datetime.now()
117 | if (self.seckill_time_obj - current_time).seconds > 180:
118 | self.driver.get("https://cart.taobao.com/cart.htm")
119 | print("每分钟刷新一次界面,防止登录超时...")
120 | sleep(60)
121 | else:
122 | print("抢购时间点将近,停止自动刷新,准备进入抢购阶段...")
123 | break
124 |
125 |
126 | def sec_kill(self):
127 | self.keep_wait()
128 | self.driver.get("https://cart.taobao.com/cart.htm")
129 | sleep(1)
130 |
131 | if self.driver.find_element_by_id("J_SelectAll1"):
132 | self.driver.find_element_by_id("J_SelectAll1").click()
133 | print("已经选中全部商品!!!")
134 |
135 | submit_succ = False
136 | retry_count = 0
137 |
138 | while True:
139 | now = datetime.now()
140 | if now >= self.seckill_time_obj:
141 | print(f"开始抢购, 尝试次数: {str(retry_count)}")
142 | if submit_succ:
143 | print("订单已经提交成功,无需继续抢购...")
144 | break
145 | if retry_count > max_retry_count:
146 | print("重试抢购次数达到上限,放弃重试...")
147 | break
148 |
149 | retry_count += 1
150 |
151 | try:
152 |
153 | if self.driver.find_element_by_id("J_Go"):
154 | self.driver.find_element_by_id("J_Go").click()
155 | print("已经点击结算按钮...")
156 | click_submit_times = 0
157 | while True:
158 | try:
159 | if click_submit_times < 10:
160 | self.driver.find_element_by_link_text('提交订单').click()
161 | print("已经点击提交订单按钮")
162 | submit_succ = True
163 | break
164 | else:
165 | print("提交订单失败...")
166 | except Exception as e:
167 |
168 | print("没发现提交按钮, 页面未加载, 重试...")
169 | click_submit_times = click_submit_times + 1
170 | sleep(0.1)
171 | except Exception as e:
172 | print(e)
173 | print("临时写的脚本, 可能出了点问题!!!")
174 |
175 | sleep(0.1)
176 | if submit_succ:
177 | self.pay()
178 |
179 |
180 | def pay(self):
181 | try:
182 | element = WebDriverWait(self.driver, 10).until(EC.presence_of_element_located((By.CLASS_NAME, 'sixDigitPassword')))
183 | element.send_keys(self.password)
184 | self.driver.find_element_by_id('J_authSubmit').click()
185 | except:
186 | print('付款失败')
187 | finally:
188 | self.driver.quit()
189 |
--------------------------------------------------------------------------------
/seckill/settings.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # encoding=utf-8
3 |
4 |
5 | DRIVER_DIR = "/usr/src/drivers"
--------------------------------------------------------------------------------
/seckill/useragents.txt:
--------------------------------------------------------------------------------
1 | Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)
2 | Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)
3 | Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/5.0)
4 | Mozilla/4.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/5.0)
5 | Mozilla/1.22 (compatible; MSIE 10.0; Windows 3.1)
6 | Mozilla/5.0 (Windows; U; MSIE 9.0; WIndows NT 9.0; en-US))
7 | Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)
8 | Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 7.1; Trident/5.0)
9 | Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; Media Center PC 6.0; InfoPath.3; MS-RTC LM 8; Zune 4.7)
10 | Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; Media Center PC 6.0; InfoPath.3; MS-RTC LM 8; Zune 4.7
11 | Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Zune 4.0; InfoPath.3; MS-RTC LM 8; .NET4.0C; .NET4.0E)
12 | Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 2.0.50727; Media Center PC 6.0)
13 | Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 2.0.50727; Media Center PC 6.0)
14 | Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Zune 4.0; Tablet PC 2.0; InfoPath.3; .NET4.0C; .NET4.0E)
15 | Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0
16 | Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; chromeframe/11.0.696.57)
17 | Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) chromeframe/10.0.648.205
18 | Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0; chromeframe/11.0.696.57)
19 | Mozilla/5.0 ( ; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
20 | Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 5.1; Trident/5.0)
21 | Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 7.1; Trident/5.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C)
22 | Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; AskTB5.5)
23 | Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; InfoPath.2; .NET4.0C; .NET4.0E)
24 | Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C)
25 | Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; FDM; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E; Tablet PC 2.0)
26 | Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; Media Center PC 4.0; SLCC1; .NET CLR 3.0.04320)
27 | Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322)
28 | Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.2; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727)
29 | Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
30 | Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.0; Trident/4.0; InfoPath.1; SV1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 3.0.04506.30)
31 | Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 5.0; Trident/4.0; FBSMTWB; .NET CLR 2.0.34861; .NET CLR 3.0.3746.3218; .NET CLR 3.5.33652; msn OptimizedIE8;ENUS)
32 | Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
33 | Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; Media Center PC 6.0; InfoPath.2; MS-RTC LM 8)
34 | Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; Media Center PC 6.0; InfoPath.2; MS-RTC LM 8
35 | Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; Media Center PC 6.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C)
36 | Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.3; .NET4.0C; .NET4.0E; .NET CLR 3.5.30729; .NET CLR 3.0.30729; MS-RTC LM 8)
37 | Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)
38 | Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Zune 3.0)
39 | Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; msn OptimizedIE8;ZHCN)
40 | Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MS-RTC LM 8; InfoPath.3; .NET4.0C; .NET4.0E) chromeframe/8.0.552.224
41 | Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MS-RTC LM 8; .NET4.0C; .NET4.0E; Zune 4.7; InfoPath.3)
42 | Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MS-RTC LM 8; .NET4.0C; .NET4.0E; Zune 4.7)
43 | Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MS-RTC LM 8)
44 | Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; Zune 4.0)
45 | Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E; MS-RTC LM 8; Zune 4.7)
46 | Mozilla/5.0 (X11; Linux x86_64; rv:2.2a1pre) Gecko/20110324 Firefox/4.2a1pre
47 | Mozilla/5.0 (X11; Linux x86_64; rv:2.2a1pre) Gecko/20100101 Firefox/4.2a1pre
48 | Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.2a1pre) Gecko/20110324 Firefox/4.2a1pre
49 | Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.2a1pre) Gecko/20110323 Firefox/4.2a1pre
50 | Mozilla/5.0 (X11; Linux x86_64; rv:2.0b9pre) Gecko/20110111 Firefox/4.0b9pre
51 | Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.0b9pre) Gecko/20101228 Firefox/4.0b9pre
52 | Mozilla/5.0 (Windows NT 5.1; rv:2.0b9pre) Gecko/20110105 Firefox/4.0b9pre
53 | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b8pre) Gecko/20101114 Firefox/4.0b8pre
54 | Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.0b8pre) Gecko/20101213 Firefox/4.0b8pre
55 | Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.0b8pre) Gecko/20101128 Firefox/4.0b8pre
56 | Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.0b8pre) Gecko/20101114 Firefox/4.0b8pre
57 | Mozilla/5.0 (Windows NT 5.1; rv:2.0b8pre) Gecko/20101127 Firefox/4.0b8pre
58 | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b8) Gecko/20100101 Firefox/4.0b8
59 | Mozilla/5.0 (Windows NT 6.1; rv:2.0b7pre) Gecko/20100921 Firefox/4.0b7pre
60 | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b7) Gecko/20101111 Firefox/4.0b7
61 | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b7) Gecko/20100101 Firefox/4.0b7
62 | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b6pre) Gecko/20100903 Firefox/4.0b6pre
63 | Mozilla/5.0 (Windows NT 6.1; rv:2.0b6pre) Gecko/20100903 Firefox/4.0b6pre Firefox/4.0b6pre
64 | Mozilla/5.0 (X11; Linux x86_64; rv:2.0b4) Gecko/20100818 Firefox/4.0b4
65 | Mozilla/5.0 (X11; Linux i686; rv:2.0b3pre) Gecko/20100731 Firefox/4.0b3pre
66 | Mozilla/5.0 (Windows NT 5.2; rv:2.0b13pre) Gecko/20110304 Firefox/4.0b13pre
67 | Mozilla/5.0 (Windows NT 5.1; rv:2.0b13pre) Gecko/20110223 Firefox/4.0b13pre
68 | Mozilla/5.0 (X11; Linux i686; rv:2.0b12pre) Gecko/20110204 Firefox/4.0b12pre
69 | Mozilla/5.0 (X11; Linux i686; rv:2.0b12pre) Gecko/20100101 Firefox/4.0b12pre
70 | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b11pre) Gecko/20110128 Firefox/4.0b11pre
71 | Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.0b11pre) Gecko/20110131 Firefox/4.0b11pre
72 | Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.0b11pre) Gecko/20110129 Firefox/4.0b11pre
73 | Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.0b11pre) Gecko/20110128 Firefox/4.0b11pre
74 | Mozilla/5.0 (Windows NT 6.1; rv:2.0b11pre) Gecko/20110126 Firefox/4.0b11pre
75 | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b11pre) Gecko/20110126 Firefox/4.0b11pre
76 | Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.0b10pre) Gecko/20110118 Firefox/4.0b10pre
77 | Mozilla/5.0 (Windows NT 6.1; rv:2.0b10pre) Gecko/20110113 Firefox/4.0b10pre
78 | Mozilla/5.0 (X11; Linux i686; rv:2.0b10) Gecko/20100101 Firefox/4.0b10
79 | Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:2.0b10) Gecko/20110126 Firefox/4.0b10
80 | Mozilla/5.0 (Windows NT 6.1; rv:2.0b10) Gecko/20110126 Firefox/4.0b10
81 | Mozilla/5.0 (X11; U; Linux x86_64; pl-PL; rv:2.0) Gecko/20110307 Firefox/4.0
82 | Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:2.0) Gecko/20110404 Fedora/16-dev Firefox/4.0
83 | Mozilla/5.0 (X11; Arch Linux i686; rv:2.0) Gecko/20110321 Firefox/4.0
84 | Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)
85 | Mozilla/5.0 (Windows NT 6.1; rv:2.0) Gecko/20110319 Firefox/4.0
86 | Mozilla/5.0 (Windows NT 6.1; rv:1.9) Gecko/20100101 Firefox/4.0
87 | Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.0.2) Gecko/20121223 Ubuntu/9.25 (jaunty) Firefox/3.8
88 | Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.0.2) Gecko/2008092313 Ubuntu/9.25 (jaunty) Firefox/3.8
89 | Mozilla/5.0 (X11; U; Linux i686; it-IT; rv:1.9.0.2) Gecko/2008092313 Ubuntu/9.25 (jaunty) Firefox/3.8
90 | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Mozilla/5.0 (X11; U; Linux i686; it-IT; rv:1.9.0.2) Gecko/2008092313 Ubuntu/9.25 (jaunty) Firefox/3.8
91 | Mozilla/5.0 (X11; U; Linux i686; ru; rv:1.9.3a5pre) Gecko/20100526 Firefox/3.7a5pre
92 | Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2b5) Gecko/20091204 Firefox/3.6b5
93 | Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2b5) Gecko/20091204 Firefox/3.6b5
94 | Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2b5) Gecko/20091204 Firefox/3.6b5
95 | Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2) Gecko/20091218 Firefox 3.6b5
96 | Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2b4) Gecko/20091124 Firefox/3.6b4 (.NET CLR 3.5.30729)
97 | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2b4) Gecko/20091124 Firefox/3.6b4
98 | Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2b1) Gecko/20091014 Firefox/3.6b1 GTB5
99 | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2a1pre) Gecko/20090428 Firefox/3.6a1pre
100 | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2a1pre) Gecko/20090405 Firefox/3.6a1pre
101 | Mozilla/5.0 (X11; U; Linux i686; ru-RU; rv:1.9.2a1pre) Gecko/20090405 Ubuntu/9.04 (jaunty) Firefox/3.6a1pre
102 | Mozilla/5.0 (Windows; Windows NT 5.1; es-ES; rv:1.9.2a1pre) Gecko/20090402 Firefox/3.6a1pre
103 | Mozilla/5.0 (Windows; Windows NT 5.1; en-US; rv:1.9.2a1pre) Gecko/20090402 Firefox/3.6a1pre
104 | Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.9.2a1pre) Gecko/20090402 Firefox/3.6a1pre (.NET CLR 3.5.30729)
105 | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100915 Gentoo Firefox/3.6.9
106 | Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.9) Gecko/20100913 Firefox/3.6.9
107 | Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9 ( .NET CLR 3.5.30729; .NET CLR 4.0.20506)
108 | Mozilla/5.0 (Windows; U; Windows NT 5.2; en-GB; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9
109 | Mozilla/5.0 (X11; U; OpenBSD i386; en-US; rv:1.9.2.8) Gecko/20101230 Firefox/3.6.8
110 | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100804 Gentoo Firefox/3.6.8
--------------------------------------------------------------------------------
/utils/__pycache__/utils.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/8090shuo/taobao_seckill/899b22851460795e6fd315493dd6b03ffc70b074/utils/__pycache__/utils.cpython-37.pyc
--------------------------------------------------------------------------------
/utils/utils.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # encoding=utf-8
3 | import os
4 |
5 |
6 | def get_useragent_data(filename: str="./useragents.txt") -> list:
7 |
8 | root_folder = os.path.dirname(__file__)
9 | user_agents_file = os.path.join(root_folder, filename)
10 | try:
11 | with open(user_agents_file, 'r', encoding='utf-8') as reader:
12 | data = [_.strip() for _ in reader.readlines()]
13 | except Exception:
14 | data = ["Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)"]
15 | return data
--------------------------------------------------------------------------------