Initial commit
This commit is contained in:
commit
b5d4cc3cf3
38
ausweisstatus.py
Executable file
38
ausweisstatus.py
Executable file
@ -0,0 +1,38 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import requests
|
||||||
|
from bs4 import BeautifulSoup
|
||||||
|
|
||||||
|
URL1 = "https://ausweisstatus.regioit.de/antragsstatusausweis_regioit/?kunde=05334002"
|
||||||
|
URL2 = "https://ausweisstatus.regioit.de/antragsstatusausweis_regioit/statusrequest.jsf"
|
||||||
|
URL3 = "https://ausweisstatus.regioit.de/antragsstatusausweis_regioit/statusresponse.jsf"
|
||||||
|
|
||||||
|
session = requests.Session()
|
||||||
|
|
||||||
|
# get session cookie and javax viewstate
|
||||||
|
resp1 = session.get(URL1)
|
||||||
|
soup = BeautifulSoup(resp1.text, "html.parser")
|
||||||
|
viewstate = soup.find(id="javax.faces.ViewState")["value"]
|
||||||
|
|
||||||
|
# send post request with payload
|
||||||
|
headers = {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
|
}
|
||||||
|
data = {
|
||||||
|
"antragsForm": "antragsForm",
|
||||||
|
"antragsForm:passauswahl": "B", # B: perso, R: reisepass
|
||||||
|
"antragsForm:seriennummer": "AAAAAAAAA",
|
||||||
|
"antragsForm:geburtsdatum": "01.01.1970",
|
||||||
|
"antragsForm:j_id22": "Antragsstatus ermitteln",
|
||||||
|
"javax.faces.ViewState": viewstate,
|
||||||
|
}
|
||||||
|
session.post(URL2, headers=headers, data=data)
|
||||||
|
|
||||||
|
# send get request to get current status
|
||||||
|
resp3 = session.get(URL3)
|
||||||
|
soup = BeautifulSoup(resp3.text, "html.parser")
|
||||||
|
status_div = soup.find(id="statusAnzeige")
|
||||||
|
status = status_div.find("strong").get_text(strip=True)
|
||||||
|
print(status)
|
||||||
|
|
||||||
|
session.close()
|
||||||
2
requirements.txt
Normal file
2
requirements.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
requests
|
||||||
|
bs4
|
||||||
Loading…
Reference in New Issue
Block a user