I was using Selenium Python to log in to Instagram and open some pages. It worked fine, but after two days the Instagram started sending the message "CSRF token missing or incorrect". And now I can't even log in with my script or manually to any accounts and with any browsers such as Chrome or FireFox on my laptop.
I'm not sending any cookies with my Selenium. And most of the search results are about Django which I'm not using.

I erased the cookies, but it it didn't work.

I tried to change my IP address to make sure if I'm banned from Instagram, but it didn't work.

I tried to check for the scrf-token in my URL with Selenium and sending it to the driver, but it didn't work.


I'm not sure if the solution is within the code, because now I can't log in even manually, so maybe there must be a problem with my system settings or from Instagram side.
Can I fix this with Selenium? Or how can I fix this?
As mentioned @350D this way probably work, but it doesn't work for me.
I had to remove my local storage (from inspect).
and if you have two step verification, you remove it temporarily.
I can't log in to Instagram: "CSRF token missing or incorrect"