1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- '''
- Created on May 28, 2020
- @author: vnc-console
- '''
- # -*- coding: utf-8
- import requests
- url1 = 'https://decl.anaf.mfinante.gov.ro/WAS6DUS/welcome.do'
- url2 = 'https://decl.anaf.mfinante.gov.ro/WAS6DUS/displayFile.do'
- header = {
- 'Host': "decl.anaf.mfinante.gov.ro",
- 'Connection': "keep-alive",
- 'Cache-Control': "max-age=0",
- 'Upgrade-Insecure-Requests': "1",
- 'Origin': "https://decl.anaf.mfinante.gov.ro",
- 'Content-Type': "multipart/form-data; boundary=----WebKitFormBoundaryQ8Yib3wqfhoOsOEA",
- 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
- 'Sec-Fetch-Site': "same-origin",
- 'Sec-Fetch-Mode': "navigate",
- 'Sec-Fetch-User': "?1",
- 'Sec-Fetch-Dest': "document",
- 'Referer': "https://decl.anaf.mfinante.gov.ro/WAS6DUS/welcome.do",
- 'Accept-Encoding': "gzip, deflate, br",
- 'Accept-Language': "en-US,en;q=0.9,ro;q=0.8",
- 'Cookie': "LastMRH_Session=cdf388d7; TIN=271000; F5_ST=1z1z1z1590666983z-1; MRHSession=b29432ff35ab290fde9df15ecdf388d7; JSESSIONID=0001nh5KSBj-cmJ3nJMdIAAJko8:-170BNG6"
- }
- file = {'submit': open('D39416_RO18123758_2020_04-semnat.pdf', 'rb')}
- payload = {'D39416_RO18123758_2020_04-semnat.pdf': 'D39416_RO18123758_2020_04-semnat.pdf'}
- cookies = dict(MRHSession='1d00ce0f72837b21a0d9f32259bd2d6c',
- JSESSIONID='0001THZF39po9P90AY9MvPb9vPQ:2J0BPR7CLJ',
- F5_ST='1z1z1z1590684057z-1',
- TIN='288000',
- LastMRH_Session='59bd2d6c')
- # r1 = requests.get(url1, data=file)
- r2 = requests.post(url2, data=file, cookies=cookies, headers=header)
- # print(r1.status_code, r1.text)
- print(r2.text)
- # with open('resp.txt', 'w') as resp:
- # resp.write(r.text)
|