import requests from bs4 import BeautifulSoup # BeautifulSoup import 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]'): print("\n" + str(ranking) + '위 : ' + tag.text) ranking = ranking + 1