1

Is it possible to access raw data from this site using python requests?

In the network tab, I found getAllDeclaration item that has POST method and specifies requests payload parameters.

So far I've tried this:

url = "https://cab.vkksu.gov.ua/rest/qa2_resultLatest/"
payload = {"PIB": "Іванов Іван Іванович", "docTypeID": "3000000768001", "yearString": "2018", "pageNum": 0}
# `docTypeID` I got from https://cab.vkksu.gov.ua/rest/qa2_interview/getInterviewType"
requests.post(url, payload)
# results in 400 response code
0

2 Answers 2

2

Try the following code, pretty sure you messed up the url part.

import requests

url = "https://cab.vkksu.gov.ua/rest/qa2_resultLatest/getAllDeclaration" 
data = {
    "PIB": "Іванов Іван Іванович", 
    "docTypeID": "3000000768001", 
    "yearString": "2018", 
    "pageNum": 0
}
response = requests.post(url, json=data)

print(response.json())
Sign up to request clarification or add additional context in comments.

Comments

0

Try this:

import json
url = "https://cab.vkksu.gov.ua/rest/qa2_resultLatest/"
payload = {"PIB": "Іванов Іван Іванович", "docTypeID": "3000000768001", "yearString": "2018", "pageNum": 0}
header = "application/json"
mydata = json.dumps(payload)
# `docTypeID` I got from https://cab.vkksu.gov.ua/rest/qa2_interview/getInterviewType"
resp = requests.post(url, mydata,header)
print(resp.content)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.