import requests from bs4 import BeautifulSoup response = requests.get('https://movie.naver.com/movie/sdb/rank/rmoive.nhm') html = response.text soup = BeautifulSoup(html, 'html.parser') ranking=1 for tag in soup.select('div[class=tit3]'): url = tag.get('href') print("\n" + str(ranking) + '위 : ' + tag.text.strip()) ranking = ranking + 1