selenium获取Cookie操作

前端之家收集整理的这篇文章主要介绍了selenium获取Cookie操作前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

直接贴代码

    Set cookies = dr.manage().getCookies();
        for (Cookie cookie : cookies) {
            System.out.println("name :" + cookie.getName() + "\n" + "value :" + cookie.getValue());
        }
以京东登陆为例:
运行结果:

selenium获取Cookie操作

猜你在找的Selenium相关文章