DB_JOB/작업파일/공공기관2/6.한국중부발전/_temp_mont.py
hehihoho3 df16c98366 백업: DB수집 전체 스냅샷 (공공기관2 정리 전)
공공기관2 작업 중. _temp 몽타주(재생성가능)는 제외.

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

26 lines
1.0 KiB
Python

# -*- coding: utf-8 -*-
import os
from playwright.sync_api import sync_playwright
os.makedirs('_nshots_tab',exist_ok=True)
pages={
'복리후생_561':'https://www.komipo.co.kr/kor/content/561/main.do?mnCd=FN01200104',
'인재육성_560':'https://www.komipo.co.kr/kor/content/560/main.do?mnCd=FN01200103',
'안전조직_492':'https://www.komipo.co.kr/esg/content/492/main.do?mnCd=ESG03050104',
}
with sync_playwright() as p:
b=p.chromium.launch()
pg=b.new_page(viewport={'width':1200,'height':2400},ignore_https_errors=True)
for name,url in pages.items():
try:
pg.goto(url,wait_until='networkidle',timeout=30000)
except:
try: pg.goto(url,wait_until='load',timeout=30000)
except Exception as e: print('ERR',name,str(e)[:50]); continue
pg.wait_for_timeout(1500)
el=pg.query_selector('#content')
try:
(el or pg).screenshot(path=f'_nshots_tab/{name}.png')
print('shot',name)
except Exception as e: print('shoterr',name,str(e)[:50])
b.close()