From 6ccc22f2cbe1dbf174a8843481b573797c022ede Mon Sep 17 00:00:00 2001 From: kim_yubin Date: Fri, 16 Nov 2018 19:07:55 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B6=94=EA=B0=80=20'=EB=B3=B5=EB=B6=99'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 복붙 | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 복붙 diff --git a/복붙 b/복붙 new file mode 100644 index 0000000..0b88148 --- /dev/null +++ b/복붙 @@ -0,0 +1,11 @@ +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 \ No newline at end of file