# coding: utf-8
import requests, re
from bs4 import BeautifulSoup
H={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'}
def fetch(u):
    r=requests.get(u,headers=H,timeout=20)
    s=BeautifulSoup(r.content,'html.parser')
    return r,s
u='https://www.kisa.or.kr/20207'
r,s=fetch(u)
print('status',r.status_code,'final',r.url)
# find sub_tab_menu
for sel in ['ul.sub_tab_menu','.sub_tab_menu','ul[class*=sub_tab]','ul[class*=tab]']:
    els=s.select(sel)
    if els:
        print('=== selector',sel,'count',len(els))
        for i,el in enumerate(els[:3]):
            print('  [%d] class=%s'%(i,el.get('class')))
            for a in el.find_all('a'):
                print('     a:', repr(a.get_text(strip=True)), '->', a.get('href'))
        break
