import requests
url = ''
data = {
'login':'login',
'pass':'pass'
}
headers = {
'User-Agent' : 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0',
'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language' : 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
'Accept-Encoding' : 'gzip, deflate',
}
s = requests.Session()
resp = s.post('https://www.fdworlds.net/auth.php', headers=headers, data=data)
resp.encoding = 'windows-1251'
soup = BeautifulSoup(resp.text)
action = soup.find('form').get('action')
resp = s.post(action,headers=headers,data=data)