from selenium import webdriver
import json,time
# 登陆并保存cookies
driver = webdriver.Chrome()
driver.get("https://www.arbmate.com/login/")
driver.implicitly_wait(30)
email = input("请输入账户:")
pw = input("请输入密码:")
driver.find_element_by_xpath('//*[@id="email"]').send_keys(email)
driver.find_element_by_xpath('//*[@id="password"]').send_keys(pw)
time.sleep(3)
driver.find_element_by_xpath('/html/body/div[1]/section/div/div/div/div/div[2]/form/div[3]/div/div/label/input').click()
time.sleep(3)
driver.find_element_by_xpath('/html/body/div[1]/section/div/div/div/div/div[2]/form/div[4]/div/button').click()
time.sleep(3)
cookies = driver.get_cookies()
with open('cookies.txt','w') as f:
f.write(json.dumps(cookies))
f.close()
读取COOKIES并保存
最新推荐文章于 2023-09-08 18:36:53 发布