for cookie in cookies_list:
driver.add_cookie(cookie)
This will throw an error as you must be on a page matching the domain of the cookie in order to set it in the webdriver.
Fix by first visiting the splash page before attempting to change cookies.
# you can only set cookies for the driver's current domain so visit the page first then set cookies
driver.get(URL)
# precautionary - delete all cookies first
driver.delete_all_cookies()
for cookie in cookies_list:
# precautionary - prevent possible Exception - can only add cookie for current domain
if "adidas" in cookie['domain']:
driver.add_cookie(cookie)
# once cookies are changed browser must be refreshed
driver.refresh()
This will throw an error as you must be on a page matching the domain of the cookie in order to set it in the webdriver.
Fix by first visiting the splash page before attempting to change cookies.