class AuxExample:
    def __init__(self):
        # Selenium headless
        self.crawl = Crawl(delay=20, telegram_notify=False, gui=False)
        self.mysql = MySQL()

    @context_manager
    def transaction(self):
        while True:
            # 데이터베이스에서 URL 가져오기
            url = self.mysql.select_one_for_update()
            if not url:
                break

            # 해당 URL 요청
            html = self.crawl.fetch(url)

            # raw_html 테이블에 업로드
            self.mysql.upload_html(url, html)

        # 정상적으로 완료된 경우 자동으로 인스턴스 종료
        os.system('poweroff')