Подскажите почему не устанавливаются куки?
from selenium import webdriver
import pickle
driver = webdriver.Firefox(executable_path='/geckodriver')
cookies = pickle.load(open("cookies.pkl","rb"))
print(cookies)
driver.delete_all_cookies()
for cook in cookies:
driver.add_cookie(cook)
driver.get('https://www.speaky.com/')
input('Текст')
#pickle.dump(driver.get_cookies(), open('cookies.pkl', 'wb'))
driver.close()
[{'name': '_gat', 'value': '1', 'path': '/', 'domain': '.speaky.com', 'secure': False, 'httpOnly': False, 'expiry': 1540676758}, {'name': 'jsessionid', 'value': 's%3A5c1wpfPKQuLfph38lv3I1iXXJmRyIDca.w6m88lwZRZkVZTgcYn%2F8omAIV0fHqkpDIjB5LSI1xJ8', 'path': '/', 'domain': 'www.speaky.com', 'secure': False, 'httpOnly': True, 'expiry': 1603748728}, {'name': 'io', 'value': '7GAKA_7DhOAe6a4IAS2I', 'path': '/', 'domain': 'www.speaky.com', 'secure': False, 'httpOnly': True}, {'name': 'amplitude_idspeaky.com', 'value': 'eyJkZXZpY2VJZCI6ImY0NDYxMjNmLTlhM2MtNDJlZS1iYzRkLWE0Mzg1MWNkZWMzY1IiLCJ1c2VySWQiOiIzMTM0NTI5Iiwib3B0T3V0IjpmYWxzZSwic2Vzc2lvbklkIjoxNTQwNjc2NzAwNjg4LCJsYXN0RXZlbnRUaW1lIjoxNTQwNjc2NzMyNDY5LCJldmVudElkIjoyLCJpZGVudGlmeUlkIjo5LCJzZXF1ZW5jZU51bWJlciI6MTF9', 'path': '/', 'domain': '.speaky.com', 'secure': False, 'httpOnly': False, 'expiry': 1856036732}, {'name': '__cfduid', 'value': 'dd2e0a017eff04db114783972b903758b1540676732', 'path': '/', 'domain': '.speaky.com', 'secure': False, 'httpOnly': True, 'expiry': 1572212732}, {'name': '_ga', 'value': 'GA1.2.411267234.1540676698', 'path': '/', 'domain': '.speaky.com', 'secure': False, 'httpOnly': False, 'expiry': 1603748737}, {'name': '_gid', 'value': 'GA1.2.1062323611.1540676698', 'path': '/', 'domain': '.speaky.com', 'secure': False, 'httpOnly': False, 'expiry': 1540763137}]
Traceback (most recent call last):
File "/home/sasha/Programm/speaky/speak.py", line 12, in <module>
driver.add_cookie(cook)
File "/home/sasha/Programm/speaky/venv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 894, in add_cookie
self.execute(Command.ADD_COOKIE, {'cookie': cookie_dict})
File "/home/sasha/Programm/speaky/venv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/home/sasha/Programm/speaky/venv/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidCookieDomainException: Message: Document is cookie-averse
Process finished with exit code 1