使用selenium模拟登录,保存cookies
代码示例:
import json
from selenium import webdriver
from selenium.webdriver.common.keys...# 切换到iframe里面,如果没有不需要,下面每一步都等待零点几秒是防止上一步还没完成,就执行了下一步
browser.switch_to.frame(browser.find_element_by_xpath...,有的是放在headers里面返回,一般是登录后保存在cookies信息里面的
if item["name"] == 'XSRF-TOKEN-CM':
...application/json;charset=UTF-8",
"Accept-Encoding": "gzip, deflate, br",
# 如果有xsrf-token请求接口时,...QA","RO","SA","SG","ZA","ES","SE","CH","TW","TH","UA","AE","GB","US","VN"]}
# allow_redirects 禁止重定向