I'd like to check the Korean population change data, so I'm going to crawl through Selenium on the site of https://jumin.mois.go.kr/. As you can see if you check the site, you can specify some conditions at this time.
The selection box is selected well among the setting conditions, but I can't click the monthly/annual button next to it. I don't know why. When I print it out, I brought the element itself, but I can't click it.
I put the code on GitHub. https://github.com/daho-jung/pythoncodes/blob/main/0428/dosele.ipynb
I'd appreciate it if you could let me know what I'm missing
python selenium
You want to do "Search", right? Then can you just try send the form?
POST https://jumin.mois.go.kr/statMonth.do
sltOrgType=1&sltOrgLvl1=A&sltOrgLvl2=A&sltUndefType=&nowYear=2021&searchYearMonth=month&searchYearStart=2021&searchMonthStart=03&searchYearEnd=2021&searchMonthEnd=03&gender=gender&genderPer=genderPer&generation=generation&sltOrderType=1&sltOrderValue=ASC
There's room for spoofing things like refurbishment, origin, and user-agent, but basically this way you can get the response you want without having to "click" on any select
.
PS. By the way, you want to know the number of people by year, right? If so, the National Statistical Portal provides open API, so check if year population data is available here.
© 2024 OneMinuteCode. All rights reserved.