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('----')
