Getting third-party and all cookies using Selenium Webdriver Java

I want to get all cookie names and domains from URl using selenium webdriver xx.21 with java,

I am using this code below:

driver.navigate().to("http://www.nextag.com");
Set<Cookie> cookies = driver.manage().getCookies();
Iterator<Cookie> itr = cookies.iterator();

    while (itr.hasNext()){
    Cookie c = itr.next();
    System.out.println("Cookie Name: " + c.getName() + " --- " + "Cookie Domain: " + c.getDomain() + " --- " + "Cookie Value: " + c.getValue());
    }

I only get a few from the code above, but when I check manually, some cookies must be deleted by advertisements such as (scorecardresearch.com) cookies, what is expected, how do I get all of this with the selenium code? Any answer would be really helpful. Thanks you

+3
source share
1 answer

, Mozilla firefox , cookie XML . cookie webdriver.

# . : http://automationoverflow.blogspot.in/2013/07/getting-cookies-from-all-domains.html

+2

All Articles