How do you get cookies from the Selenium nodes?
My crawling requirements are now so complicated that I believe that I need the Selenium nodes to compliment the Palladium nodes. But please bear with me as I am a complete newbie to Selenium and Selenium nodes.
The Selenium documentation says:
Selenium webdriver can perform required task with respect to browser cookies. We add , delete, delete particular cookie by passing the name, and so on.
Method Name: getCookies()
Purpose: Get all the cookies for the current domain. This is the equivalent of calling "document.cookie" and parsing the result.
Returns: A Set of cookies for the current domain.
But the nodes that connect downstream of the Selenium "Start WebDriver" node only seem to be capable of extracting Elements and CSS.
I tried writing a JSON script and connecting it directly to the "WebDriver Factory" but I got the error "Configre failed (RuntimeException): Step type 'getCookies' is not implemented".
a dedicated "Cookie" node will be available in a future update which is coming soon.
Anyway, hope this helps,
Thanks! I just needed a little push in the right direction. This solution seems to be all I need ... at least for the moment.
I didn't know about the HttpOnly flag - thanks for the heads up - it look ominous! When you say "accessing these kind of cookies is currently not supported" do you mean that Selenium Nodes doesn't support it, or the Selenium framework doesn't support it, or the underlying PhantomJS browser doesn't support it? Which layer prevents access to these cookies? Is it something you can ultimately provide via Selenium Nodes?
Managing cookies are a huge deal for me so I'm looking forward to seeing the dedicated Cookie node.
When you say "accessing these kind of cookies is currently not supported" do you mean that Selenium Nodes doesn't support it, or the Selenium framework doesn't support it, or the underlying PhantomJS browser doesn't support it? Which layer prevents access to these cookies? Is it something you can ultimately provide via Selenium Nodes?
There are potential workarounds, e.g. when using PhantomJS, the cookies file can be accessed directly without the Selenium API. This is a feature which we could eventually offer in the Selenium Nodes, but it's currently not a very short-term priority.