https://stackoverflow.com/a/67389309/1437261
import requests
s = requests.Session()
resp_get = s.get(your_get_url, headers=your_get_headers)
resp_post = s.post(your_post_url, headers=your_post_headers, data=your_post_data)
Are you using the same session, or a fresh session on each request? That could be it. Try configuring the browser to use existing profile on the subsequent requests.
Edit:
Something like this should work..
Code:https://stackoverflow.com/a/67389309/1437261
As this is about requests, you need to have a persistent session for all your request transactions:
Code:import requests s = requests.Session() resp_get = s.get(your_get_url, headers=your_get_headers) resp_post = s.post(your_post_url, headers=your_post_headers, data=your_post_data)
Oh lol I totally thought he was using selenium. But yeah, the same concept applies for requests as well.As this is about requests, you need to have a persistent session for all your request transactions:
Code:import requests s = requests.Session() resp_get = s.get(your_get_url, headers=your_get_headers) resp_post = s.post(your_post_url, headers=your_post_headers, data=your_post_data)
and by using the same session, you also send the same cookies.. So, the same solution should work for your case.problem wasn’t that, I did not read well. Problem is in requests cookies
Yeah, but it says wrong cookies, I would need to figure that out. Thanks anywayOh lol I totally thought he was using selenium. But yeah, the same concept applies for requests as well.
and by using the same session, you also send the same cookies.. So, the same solution should work for your case.
still saying CSRF token failed
Can you share the exact error message?it says wrong cookies
It says that cookies arw wrong or required from web browserCan you share the exact error message?
Maybe there are some thing you need to populate in the POST data, separate from the Cookie header.
Can't get too much clues on that...It says that cookies arw wrong or required from web browser
I would try figure it out myself, thanksCan't get too much clues on that...
Stackoverflow and Youtube are your friends, but if you're still having issues I can try to help by PM if privacy is a concern.
Can you please PM me?Can't get too much clues on that...
Stackoverflow and Youtube are your friends, but if you're still having issues I can try to help by PM if privacy is a concern.