【发布时间】:2020-02-27 19:04:24
【问题描述】:
我想获取存储在开发人员工具中“应用程序”选项卡下的 LocalStorage 对象中的特定密钥。
我使用请求来访问网页,但我一直在尝试使用带有 selenium 的 python 绑定来获取元素。但是元素上的 execute_script 获取为 none
from selenium.webdriver import Firefox
browser = Firefox(options=opts)
browser.get('https://stackoverflow.com')
print (browser.execute_script('return localStorage.getItem("se:fkey");'))
【问题讨论】:
标签: python selenium-webdriver python-requests