with Chrome() as driver:
driver.get(notebooks[0])
for cookie in pickle.load(open('cookies.pkl', 'rb')):
driver.add_cookie(cookie)
I dumped the cookies first by logging in manually, but getting this error while setting them.
Found the answer to it!
Found out that google doesn't allow sending 'sameSite' cookie set to 'None'
Since 'sameSite' cookie was set to 'None' when I saved it from site, so sending it set to 'None' was against google's policy, resulting in assertion that it should be 'Strict' or 'Lax'
Here is the code that solved the problem
for cookie in pickle.load(open('cookies.pkl', 'rb')):
if 'sameSite' in cookie:
if cookie['sameSite'] == 'None':
cookie['sameSite'] = 'Strict'
driver.add_cookie(cookie)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With