def buy(buytime):
while True:
now = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')
if now > buytime:
if driver.find_element_by_link_text("立即购买"):
driver.find_element_by_link_text("立即购买").click()
break
time.sleep(0.0001)
while True:
try:
if driver.find_element_by_link_text("提交订单"):
driver.find_element_by_link_text("提交订单").click()
except:
time.sleep(1)
print(now)
time.sleep(0.0001)