yubin_repository/복붙

11 lines
352 B
Plaintext
Raw Permalink Normal View History

2018-11-16 10:07:55 +00:00
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