import schedule
import time
import requests
from bs4 import BeautifulSoup  # BeautifulSoup import

def getTitles():
    response = requests.get('https://movie.naver.com/movie/sdb/rank/rmovie.nhn')
    html = response.text
    soup = BeautifulSoup(html, 'html.parser')  # html.parser를 사용해서 soup에 넣겠다
    ranking = 1
    for tag in soup.select('div[class=tit3]'):
        url = tag.get('href')
        print(str(ranking) + '위 : ' + tag.text.strip().replace("\n", ""))
        ranking = ranking + 1

schedule.every(1).seconds.do(getTitles)
# schedule.every(10).minutes.do(getTitles)
# schedule.every().hour.do(getTitles)
# schedule.every().day.at("10:30").do(getTitles)
# schedule.every(5).to(10).minutes.do(getTitles)
# schedule.every().monday.do(getTitles)
# schedule.every().wednesday.at("13:15").do(getTitles)

while True:
    schedule.run_pending()
    time.sleep(1)