Can't pass csrf token on factorio.com/login
Posted: Fri Apr 12, 2019 8:11 pm
I need help with non-browser factorio.com auth.
I read instructions a lot of times maybe i am bit idiot, but anyway:
Returned page is saying, that 'The CSRF token is missing.'
I read instructions a lot of times maybe i am bit idiot, but anyway:
Code: Select all
import requests
from bs4 import BeautifulSoup
s = requests.session()
data = s.get('https://www.factorio.com/login')
soup = BeautifulSoup(data.content, 'html.parser')
token = soup.find_all('input', id='csrf_token')[0]['value']
newdata = s.post('https://www.factorio.com/login?csrf_token='+str(token)+'&username_or_email=&password=')