How to get all cookies from a new instance of Firefox browser
Using the following to create the firefox driver
profile = Selenium::WebDriver::Firefox::Profile.new
profile['general.useragent.override'] = agent
browser = Watir::Browser.new :firefox, profile: profile
Executing the request: -
broswer.goto "http://goo.gl/QFsO6R"
Its redirecting to the amazon site and getting the cookie value from the amazon site.
But I want to get the cookies of this page ( http://goo.gl/QFsO6R ) that is loaded. How can I get it.
To get cookies I use the following: -
browser.cookies.to_a
browser.driver.manage.all_cookies
If you are making a request with three different urls using firefox profile. Then I want to get all the cookies stored in the browser. How can I get it?
+3
source to share
2 answers