python秒杀_python实现京东秒杀功能本⽂实例为⼤家分享了python实现京东秒杀的具体代码,供⼤家参考,具体内容如下
# _*_coding:utf-8_*_
from selenium import webdriver
import datetime京东python入门教程
import time
driver = webdriver.Chrome(executable_path='')
def login(uname, pwd):
<("www.jd")
driver.find_element_by_link_text("你好,请登录").click()
driver.find_element_by_link_text("账户登录").click()
driver.find_element_by_name("loginname").send_keys(uname)
driver.find_element_by_name("nloginpwd").send_keys(pwd)
fastjson漏洞替换方案gulped是什么意思driver.find_element_by_id("loginsubmit").click()
<("cart.jd/cart.action")王佩丰excel教程视频
driver.find_element_by_link_text("去结算").click()
now = w()
print('login success:',now.strftime('%Y-%m-%d %H:%M:%S'))
# buytime = '2016-12-27 22:31:00'
def buy_on_time(buytime):
while True:
now = w()
if now.strftime('%Y-%m-%d %H:%M:%S') == buytime:
codeblocks下载步骤
儿童编程软件免费中文版while True:
try:
driver.find_element_by_id('order-submit').click()
except Exception as e:
time.sleep(0.1)
print ('purchase success',now.strftime('%Y-%m-%d %H:%M:%S'))
time.sleep(0.5)
# entrance
login('username', 'password')
buy_on_time('2017-01-01 14:00:01')
以上就是本⽂的全部内容,希望对⼤家的学习有所帮助,也希望⼤家多多⽀持本⽹站。
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论