๋ง์ฝ imax์์์ ์ฌ๋ฌ๊ฐ ํ๋ค๋ฉด ์ด๋ป๊ฒ ๊ตฌํ์ ํด์ผ๋๋์?
์ ๋ ๊ถ๊ธํด์ ํ๋ฒ ์ฝ๋ ์์ฑํด๋ณด์๋๋ฐ, ์ฌ๋ฌ๊ฐ๋ ์๋ฆผ์ด ๊ฐ๋๋ก ๊ตฌํ์ด ๊ฐ๋ฅํ๋ค์! ์ฐธ๊ณ ๋ก ์ ๋ imax ์์ ์ํ ๋ง๊ณ , tempurCinema ์์ ์ํ๋ก ํ๋ค๋ ์ ์ ์ํ์๊ธธ ๋ฐ๋๋๋ค. ๊ฐ๊ฐ์ ์ํ ๋ณ๋ก ๋๋ ์ง col-times ํด๋์ค์ div ํ๊ทธ ์์ชฝ ๋ด์ฉ์ผ๋ก ๋ฐ๋ณต๋ฌธ์ ๋๋ฆฌ๋ฉฐ, temputCinema ํด๋์ค์ธ span ํ๊ทธ๊ฐ ์๋์ง ์กฐ๊ฑด๋ฌธ์ผ๋ก ํ์ธํ๊ณ ,์๋ค๋ฉด ํด๋น col-times ํด๋์ค์ div ํ๊ทธ์ ๊ฑธ์ณ์ง๋ ๋ชจ๋ ์์ญ ์ค strong ํ๊ทธ์ ํ
์คํธ๋ฅผ ์ ํํ์ฌ ๋ฉ์์ง๋ฅผ ์ ์กํ ์ ์์ต๋๋ค.import requestsimport telegramfrom bs4 import BeautifulSoupfrom apscheduler.schedulers.blocking import BlockingSchedulerbot = telegram.Bot(token = '5087679237:AAHASP7XCcdj26RHW20HZFt56YTzndsaZe0')url = 'http://www.cgv.co.kr/common/showtimes/iframeTheater.aspx?areacode=01&theatercode=P013&date=20220121&screencodes=&screenratingcode=09ยฎioncode=103'def job_function(): html = requests.get(url) soup = BeautifulSoup(html.text, 'html.parser') parent = soup.select('div.col-times') for i in parent: tempurCinema = i.select_one('span.tempurCinema') if(tempurCinema): title = i.select_one('div.info-movie > a > strong').text.strip() bot.sendMessage(chat_id=5062868275, text=title + " tempurCinema ์๋งค๊ฐ ์ด๋ ธ์ต๋๋ค.") sched.pause() #else: #bot.sendMessage(chat_id=5062868275, text = "tempurCinema ์๋งค๊ฐ ์ด๋ฆฌ์ง ์์์ต๋๋ค.") #print('tempurCinema ์๋งค๊ฐ ์ด๋ฆฌ์ง ์์์ต๋๋ค.')sched = BlockingScheduler()sched.add_job(job_function, 'interval', seconds=5)sched.start()