import requests name = 'Roman' password = '1221121' headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; rv:69.0) Gecko/20100101 Firefox/69.0'} r = requests.session() html = r.get('https://www.pvpro.com/pvpro/account/choose', headers=headers) html2 = str(html.content) hml = html2.split('meta name') html3 = hml[4].replace('"_csrf" content="', '') html4 = html3.replace('"/>\\n', '') csrfbeta = html4.replace('=', '') csrfbeta = csrfbeta.replace('<', '') csrf = csrfbeta.replace(' ', '') print(csrf) data = {'username': name, 'password': password, '_csrf': csrf} htmlbeta = r.get('https://www.pvpro.com/pvpro/account/choose', headers=headers, data=data) htmlbeta = str(htmlbeta.content) print(htmlbeta) if 'Login Failed' in htmlbeta: print('Fail') else: print('Good') Код import requests name = 'Roman' password = '1221121' headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; rv:69.0) Gecko/20100101 Firefox/69.0'} r = requests.session() html = r.get('https://www.pvpro.com/pvpro/account/choose', headers=headers) html2 = str(html.content) hml = html2.split('meta name') html3 = hml[4].replace('"_csrf" content="', '') html4 = html3.replace('"/>\\n', '') csrfbeta = html4.replace('=', '') csrfbeta = csrfbeta.replace('<', '') csrf = csrfbeta.replace(' ', '') print(csrf) data = {'username': name, 'password': password, '_csrf': csrf} htmlbeta = r.get('https://www.pvpro.com/pvpro/account/choose', headers=headers, data=data) htmlbeta = str(htmlbeta.content) print(htmlbeta) if 'Login Failed' in htmlbeta: print('Fail') else: print('Good') Сперва я открываю сесию, потом парсю csrf токен, и отправляю логин + пас с токеном на сайт, и на выходе ошибка b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional// org/TR/html4/loose.dtd">\n<HTML><HEAD><META HTTP-EQUIV="Conte ext/html; charset=iso-8859-1">\n<TITLE>ERROR: The request cou </TITLE>\n</HEAD><BODY>\n<H1>403 ERROR</H1>\n<H2>The request ied.</H2>\n<HR noshade size="1px">\nBad request.\nWe can\'t c r for this app or website at this time. There might be too mu figuration error. Try again later, or contact the app or webs ar="all">\nIf you provide content to customers through CloudF steps to troubleshoot and help prevent this error by reviewin cumentation.\n<BR clear="all">\n<HR noshade size="1px">\n<PRE udfront (CloudFront)\nRequest ID: Zzl_8qIxphDBN8o30j1GDWXvgy8 _endl97A==\n</PRE>\n<ADDRESS>\n</ADDRESS>\n</BODY></HTML>'