You can now check the Online application status of special fixed-amount benefits on the Ota Ward website. If you are applying online, use Beautiful Soup because you can know your application status from the reception number. I will try to get information such as application status.
The modification date and time can be obtained from the Last-Modified response header.
print(res.headers['Last-Modified'])
#Output Mon, 25 May 2020 08:49:00 GMT
The application status can be obtained from the ul and li tags in id = "main". You can get a list including application status by specifying with select ().
If you have applied online, you will be issued a reception number so you can compare it with your own number to know the current status.
import requests, bs4
import re
res = requests.get('https://www.city.ota.tokyo.jp/cyuumokujoho/infection/kyufu/teigakukyuuhuonlinejokyo.html')
res.raise_for_status()
soup = bs4.BeautifulSoup(res.content, "html.parser")
elements = soup.select('#main ul li')
kyufu = 0
next = 0
for element in elements:
text = element.getText()
if 'Number of applications' in text:
print(text)
if 'Benefit decision status' in text:
print(text)
kyufu = re.findall('[0-9]+', text)[0]
if 'Scheduled to be decided next time' in text:
print(text)
next = re.findall('[0-9]+', text)[0]
number = 200503009999999
if int(kyufu) > number:
print("The application processing status is now the benefit decision status.")
elif int(next) > number:
print("The application processing status will be decided next time.")
else:
print("The application processing status is awaiting examination.")
#output
Number of applications 23,848 cases
Benefit decision status Until reception number 200502004219879 Benefit decision
Scheduled to be decided next time Until reception number 200506012800746
The application processing status will be decided next time.
A guideline for the transfer date is also provided from the application date. You can get it from the p tag in id = "main" as well as the application status.
elems = soup.select('#main p')
print(elems[4].getText().replace('。5', '。\n5'))
#output
Applications for May 1st (Friday): The transfer will be completed by 26th (Tuesday) (excluding applications for which there was an input error, etc. The same shall apply hereinafter).
Application for May 2nd (Saturday): Transfers will be made on 26th (Tuesday), 29th (Friday), and June 2nd (Tuesday).
May 3rd (Sunday) Application: The transfer will start from June 2nd (Tuesday).
Application for May 4th (Monday): Transfer will start from June 2nd (Tuesday).
Application for May 5th (Tuesday): Transfer will start from June 2nd (Tuesday).
May 6th (Wednesday) Application: Transfer will start from June 2nd (Tuesday).
May 7th (Thursday) Application: The transfer will start from June 5th (Friday).
Applications after Friday, May 8 will also be transferred in sequence. Note: The transfer schedule is a guide. Please note that it may take some time depending on the progress and input errors.
[Python] Get the last updated date of the website Beautiful Soup to understand in 10 minutes
Recommended Posts