python爬虫获取localStorage中的数据(获取token)

# 此为获取东航登录时的token(经分析js得出此token存储于localstorage中)

python爬虫获取localStorage中的数据(获取token)

browser = webdriver.Chrome(executable_path=‘xxxx‘)browser.get(‘https://passport.ceair.com/?redirectUrl=http%3A%2F%2Fwww.ceair.com%2F#/ffp‘)token = browser.execute_script("return localStorage.getItem(‘apdid_data‘)")print(token)