#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 2018/09/05
# 淘宝秒杀脚本,扫码登录版
import os
from selenium import webdriver
import datetime
import time
from os import path
from selenium.webdriver.common.action_chains import ActionChains
d = path.dirname(__file__)
abspath = path.abspath(d)
driver=webdriver.Chrome('C:\chromedriver.exe')
print("start webdriver")
#driver = webdriver.Firefox()
driver.maximize_window()
def login():
# 打开淘宝登录页,并进行扫码登录
driver.get("https://www.taobao.com")
time.sleep(3)
if driver.find_element_by_link_text("亲,请登录"):
driver.find_element_by_link_text("亲,请登录").click()
print("请在30秒内完成扫码")
time.sleep(30)
print("cart1")
driver.get("https://cart.taobao.com/ca