Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- from bs4 import BeautifulSoup
- s = requests.session()
- validation_url = 'https://bankrot.fedresurs.ru/DebtorsSearch.aspx'
- form_response = s.post(validation_url)
- soup = BeautifulSoup(form_response.content, 'html.parser')
- viewstate = soup.find('input', id='__VIEWSTATE').get('value')
- viewgenerator = soup.find('input', id='__VIEWSTATEGENERATOR').get('value')
- previouspage = soup.find('input', id='__PREVIOUSPAGE').get('value')
- # print(previouspage)
- item_request_body = {
- '__EVENTTARGET': "",
- '__EVENTARGUMENT': "",
- '__VIEWSTATE': viewstate,
- '__VIEWSTATEGENERATOR': viewgenerator,
- '__PREVIOUSPAGE': '',
- 'ctl00$PrivateOffice1$tbLogin': "",
- 'ctl00$PrivateOffice1$tbPassword': "",
- 'ctl00$PrivateOffice1$cbRememberMe': "on",
- 'ctl00$PrivateOffice1$tbEmailForPassword': "",
- 'ctl00_PrivateOffice1_RadToolTip1_ClientState': "",
- 'ctl00$DebtorSearch1$inputDebtor': "поиск",
- 'ctl00$cphBody$rblDebtorType': "Persons",
- 'ctl00$cphBody$tbOrgName': "",
- 'ctl00$cphBody$tbOrgAddress': "",
- 'ctl00$cphBody$ucOrgRegionList$ddlBoundList': "",
- 'ctl00$cphBody$ucOrgCategoryList$ddlBoundList': "",
- 'ctl00$cphBody$OrganizationCode1$CodeTextBox': "",
- 'ctl00$cphBody$tbPrsLastName': "Иванов",
- 'ctl00$cphBody$tbPrsFirstName': "Иван",
- 'ctl00$cphBody$tbPrsMiddleName': "",
- 'ctl00$cphBody$tbPrsAddress': "",
- 'ctl00$cphBody$ucPrsRegionList$ddlBoundList': "",
- 'ctl00$cphBody$ucPrsCategoryList$ddlBoundList': "",
- 'ctl00$cphBody$PersonCode1$CodeTextBox': "",
- 'ctl00$cphBody$btnSearch.x': "48",
- 'ctl00$cphBody$btnSearch.y': "14"
- }
- response = s.post(url=validation_url, data=item_request_body)
- print(response)
- print(form_response.url)
- print(response.text)
Add Comment
Please, Sign In to add comment