I
I
Ivan Yakushenko2019-07-23 12:49:41
Python
Ivan Yakushenko, 2019-07-23 12:49:41

How to get all cookies with Selenium?

There is a site from which you need to get the following cookies:

Screenshots
1HS1I.jpg
2vvZU.jpg
is775.jpg

When trying to get them like this:
cookies = driver.get_cookies()
I only get:
[{'domain': 'livefootball.ru', 'httpOnly': False, 'name': 'atexc', 'path': '/', 'secure': False, 'value': '0,1,2,3,4,5,6,7,$$'}, {'domain': 'livefootball.ru', 'httpOnly': False, 'name': 'atref', 'path': '/', 'secure': False, 'value': 'noref$$'}]

What other ways are there to get cookies, and why don't they all go initially?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Eremin, 2019-07-23
@kshnkvn

this is the idea of ​​cookies - you, being on the site, can only work with the cookies of the current site
if you could work with all browser cookies at all, this would be a serious jamb in safety - because then you can steal your sessions on other resources
If you know the list domains in advance, you can cycle through each of them and pick up the current cookies

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question