DB_JOB/작업파일/공공기관2/10.한국지역난방공사/_raw.py
hehihoho3 b0acd1e705 백업: 셀병합 정상화(D~J)+KDHC 옵션2/행높이17, 오늘(06-21) 제출 17곳 검수·압축
- 공공기관2/3 작업본 + 오늘 제출 17곳 D~J 카테고리 셀병합 정상화
- 한국지역난방공사 옵션2(고아셀 F98 수정)+전행 높이17
- 제출_프리랜서2_2026-06-21.zip 생성(17개 xlsx, 2,468행)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 13:21:26 +09:00

22 lines
963 B
Python

import requests,re
from bs4 import BeautifulSoup
import urllib3; urllib3.disable_warnings()
H={'User-Agent':'Mozilla/5.0'}
for nm,u in {
'사회공헌위원회':"https://www.kdhc.co.kr/kdhc/bbs/B0000008/list.do?menuNo=200106",
'한난사보20-23':"https://www.kdhc.co.kr/kdhc/prCnter/cyclb/list.do?prTargetSe=2&menuNo=200127",
}.items():
r=requests.get(u,headers=H,timeout=25,verify=False)
s=BeautifulSoup(r.content,'html.parser')
main=s.select_one('#contents, #content, .sub_contents, .contents, #container')
print('==',nm,'len main=',len(main.get_text(strip=True)) if main else 'NoMain')
if main:
# print structural skeleton: tags with classes
print(main.get_text(' ',strip=True)[:300])
# look for total in scripts
for sc in s.find_all('script'):
t=sc.string or ''
m=re.search(r'(totalCnt|totCnt|recordCount|total)\D{0,5}(\d+)',t)
if m: print(' script total:',m.group(0))
print('----')