一、完整代码(持续更新)
import os
import time
import pickle
from time import sleep
from selenium import webdriver
# 大麦网主页
damai_url = "https://www.damai.cn/"
# 登录页
login_url = "https://passport.damai.cn/login?ru=https%3A%2F%2Fwww.damai.cn%2F"
# 抢票目标页
target_url = "https://detail.damai.cn/item.htm?spm=a2oeg.search_category.0.0.77f24d15RWgT4o&id=654534889506&clicktitle=%E5%A4%A7%E4%BC%97%E7"
class Concert:
def __init__(self):
self.status = 0 # 状态,表示如今进行到何种程度
self.login_method = 1 # {0:模拟登录,1:Cookie登录}自行选择登录方式
self.driver = webdriver.Chrome(executable_path='D:\chromedriver\chromedriver_win32\chromedriver.exe') # 默认C