o
    g                     @   s$   d dl mZ d dlmZ dd ZdS )    )BeautifulSoup)
fetch_htmlc                  C   sp   d} t | }|s
g S t|d}|d}g }|D ]}|jdd}|r'|| q|r6|d dkr6|dd  S |S )	Nz+https://www.motie.go.kr/kor/26/headquarterszhtml.parserz(a[onclick*='headquarters.jsSearchOrgan']T)stripr   u   전체   )r   r   selectget_textappend)urlhtmlsoupoptionsdepartmentsatext r   ./var/www/html/bot/services/motie_vip_parser.pyget_motie_departments   s   


 r   N)bs4r   utils.fetcherr   r   r   r   r   r   <module>   s   