- 공공기관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>
35 lines
1.3 KiB
Python
35 lines
1.3 KiB
Python
import requests,json,io,re,time
|
||
from bs4 import BeautifulSoup
|
||
from urllib.parse import urljoin
|
||
import urllib3; urllib3.disable_warnings()
|
||
H={'User-Agent':'Mozilla/5.0'}
|
||
BASE="https://www.kdhc.co.kr"
|
||
def fetch(u):
|
||
r=requests.get(u,headers=H,timeout=25,verify=False); return r
|
||
# G7 raw hrefs (사전정보공표) - fetch r11 page
|
||
r=fetch("https://www.kdhc.co.kr/kdhc/infoOthbc/infoPrmlgt/list.do?menuNo=200013")
|
||
s=BeautifulSoup(r.content,'html.parser')
|
||
print("=== G7 사전정보공표 tebLi raw ===")
|
||
for ul in s.find_all('ul'):
|
||
lis=ul.find_all('li',class_='tebLi')
|
||
if not lis: continue
|
||
for li in lis:
|
||
a=li.find('a')
|
||
if a: print(' ',repr(a.get_text(strip=True)),'->',a.get('href'))
|
||
break
|
||
# check '전체' / total count on board
|
||
tot=s.find(string=re.compile(r'(전체|총)\s*[::]?\s*\d'))
|
||
print('total hint:',repr(tot.strip()[:60]) if tot else None)
|
||
|
||
# G9 안전경영 raw hrefs (None menuNo case)
|
||
print("=== G9 안전경영 tebLi raw ===")
|
||
r=fetch("https://www.kdhc.co.kr/kdhc/main/contents.do?menuNo=200088")
|
||
s=BeautifulSoup(r.content,'html.parser')
|
||
for ul in s.find_all('ul'):
|
||
lis=ul.find_all('li',class_='tebLi')
|
||
if not lis: continue
|
||
for li in lis:
|
||
a=li.find('a')
|
||
if a: print(' ',repr(a.get_text(strip=True)),'->',a.get('href'))
|
||
break
|