How to remove Firefox cookies from webdriver in python?

when I cannot delete FF cookies from webdriver. When I use the method .delete_all_cookies, it returns None. And when I try get_cookies, I get the following error:

webdriver_common.exceptions.ErrorInResponseException: Error occurred when processing
packet: Content-Length: 120
{"elementId": "null", "context": "{9b44672f-d547-43a8-a01e-a504e617cfc1}", "parameters": [], "commandName": "getCookie"}
response: Length: 266
{"commandName": "getCookie", "isError": true, "response": {"lineNumber": 576, "message": "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMLocation.host]", "name" : "NS_ERROR_FAILURE"}, "elementId": "null", "context": "{9b44672f-d547-43a8-a01e-a504e617cfc1}"}

How can i fix this?

Update:

This happens when you clean install webdriver without any changes. The changes that I mentioned in another post were made later than this post was published (I myself tried to solve the problem).

0
source share
1 answer

, Webdriver, ... , js cookie delete cookie. get_cookies , ? , cookie ? , , webdriver-read-only\firefox\src\extension\components\firefoxDriver.js, . , , cookie? , .

, Selenium Webdriver, Selenium. . , , , Webdriver . Selenium, . , , - API Python, selenium rc, API Python selenium-client-driver-python, 5 , Python, , , cookie , . - , () - cookie, , / cookie python selenium getEval(), js, (, "alert()" ).... , , , .

0
source

Source: https://habr.com/ru/post/1724193/


All Articles