E
E
eyyuioa2020-12-20 00:00:52
PHP
eyyuioa, 2020-12-20 00:00:52

How to quickly set cookies via Selenium for a large number of domains?

I use the php-webdriver library, when I try to set cookies for another domain, it throws an Exception saying that it is impossible to perform this action. The only option I could find for her was to loop through the list to go to each site and set cookies for it. Well, if there are 2-3 sites, but if there are 10 or more, then this is a rather time-consuming operation. Therefore, the question is, is it possible to somehow set cookies for the browser in one action, or at least without downloading each resource?
Ps In order for all this to happen quickly, I turn off the loading of images and JS, and then turn it on again, but this is still not enough, too slow.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel, 2020-12-24
@prafair

It won't work without loading, it's built into the web driver (see https://w3c.github.io/webdriver/#add-cookie and https://w3c.github.io/webdriver/#dfn-invalid-cookie.. . )
Perhaps an article about how to quickly set cookies https://link.medium.com/x4UzstWotcb will help

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question