gpt4 book ai didi

selenium-webdriver - Selenium 网络驱动程序 : How to get All cookies in the Current page

转载 作者:行者123 更新时间:2023-12-02 01:03:56 26 4
gpt4 key购买 nike

尝试使用带有 java 的 Chrome 驱动程序获取当前页面中的所有 cookie。请帮助我在关闭浏览器并尝试使用旧 cookie 打开新浏览器后检索页面中的所有 cookie。

最佳答案

使用位于以下位置的 WebDriver API:

http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/WebDriver.Options.html

获取当前页面的所有 cookie 并解析为 cookie 对象集合:

     driver.manage().getCookies();
//TODO Parse results to Cookie Objects and Do what you want

关于selenium-webdriver - Selenium 网络驱动程序 : How to get All cookies in the Current page,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24912204/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com