DB_JOB/작업파일/공공기관2/6.한국중부발전/_temp_vchk.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

23 lines
1.3 KiB
Python

# -*- coding: utf-8 -*-
import ssl,urllib.request,re
from bs4 import BeautifulSoup
ctx=ssl.create_default_context();ctx.check_hostname=False;ctx.verify_mode=ssl.CERT_NONE
HDR={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/124 Safari/537.36'}
def fetch(u): return urllib.request.urlopen(urllib.request.Request(u,headers=HDR),timeout=25,context=ctx).read()
rows={
'r107_해외재생_46':'https://www.komipo.co.kr/kor/content/46/main.do?mnCd=FN020903',
'r163_ESG홍보영상_642':'https://www.komipo.co.kr/esg/content/642/main.do?mnCd=ESG010205',
'r222_홍보영상_126':'https://www.komipo.co.kr/kor/content/126/main.do?mnCd=FN0902',
'r223_KOMIPOMEDIA_215':'https://www.komipo.co.kr/kor/content/215/main.do?mnCd=FN090202',
'r166_기후변화_102':'https://www.komipo.co.kr/esg/content/102/main.do?mnCd=ESG020201',
}
for n,u in rows.items():
soup=BeautifulSoup(fetch(u),'html.parser')
cont=soup.select_one('#content') or soup
vids=cont.find_all('video')
iframes=[i.get('src','') for i in cont.find_all('iframe') if i.get('src')]
yt=[s for s in iframes if 'youtube' in s or 'youtu.be' in s or 'vimeo' in s]
htmlv=re.findall(r'(youtube\.com/embed|youtu\.be|vimeo\.com|\.mp4)', str(cont))
print(f'{n}: <video>{len(vids)} iframe{len(iframes)} yt/vimeo{len(yt)} htmlvid{set(htmlv)}')
if yt: print(' ', yt[:2])