{"id":8307,"date":"2019-01-22T23:02:45","date_gmt":"2019-01-22T14:02:45","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=8307"},"modified":"2020-05-28T12:59:21","modified_gmt":"2020-05-28T03:59:21","slug":"%ec%9b%b9-%ed%81%ac%eb%a1%a4%eb%a7%81","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=8307","title":{"rendered":"\uc6f9 \ud06c\ub864\ub9c1"},"content":{"rendered":"<p>Python\uc744 \uc774\uc6a9\ud574 \uc6f9 \ud398\uc774\uc9c0\uc5d0\uc11c \uc6d0\ud558\ub294 \uc815\ubcf4\ub97c \ucd94\ucd9c\ud574 \ub0b4\ub294 \ucf54\ub4dc\ub2e4. \uc544\ub798\ub294 \ub124\uc774\ubc84 \ub274\uc2a4\uc758 \uc624\ub298 \ub0a0\uc9dc\uc5d0 \ub300\ud55c \ud1a0\ud53d \uc81c\ubaa9\uacfc \ud574\ub2f9 url\uc744 \ubf51\uc544\ub0b4\ub294 \ucf54\ub4dc \uc608\uc81c.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">\r\nimport requests\r\nfrom bs4 import BeautifulSoup\r\n\r\nurl = 'https:\/\/news.naver.com\/main\/ranking\/popularDay.nhn?rankingType=popular_day&date=20191022'\r\n\r\nr = requests.get(url)\r\nhtml = r.content\r\nsoup = BeautifulSoup(html, 'html.parser')\r\ntitles_html = soup.select('.ranking_section > ol > li > dl > dt > a')\r\n\r\nfor i in range(len(titles_html)):\r\n    print('#' + str(i+1), titles_html[i].text)\r\n    print(titles_html[i]['href'])\r\n    print()\r\n<\/pre>\n<p>\uacb0\uacfc\ub294 \ub300\ub7b5 \uc544\ub798\uc640 \uac19\ub2e4.<\/p>\n<p><code>#1 \ub7ec \uad70\uc6a9\uae30 6\ub300\uc758 \ubb34\ub825 \uc2dc\uc704\u00b7\u00b7\u00b7\ud55c\ubc18\ub3c4 3\uba74 \ub2e4 \ud5e4\uc9d1\uace0 \ub2e4\ub154\u2026<br \/>\n\/main\/ranking\/read.nhn?mid=etc&sid1=111&rankingType=popular_day&oid=025&aid=0002946814&date=20191022&type=1&rankingSectionId=100&rankingSeq=1<\/p>\n<p>#2 \uc2dc\uc815\uc5f0\uc124 \ub9c8\uce5c \u6587, \uc774\ucca0\ud76c\uc5d0 \uac74\ub128 \ub9d0 \"\uc12d\uc12d\ud55c\uac00 \uc2dc\uc6d0\ud55c\uac00\"<br \/>\n\/main\/ranking\/read.nhn?mid=etc&sid1=111&rankingType=popular_day&oid=025&aid=0002946806&date=20191022&type=1&rankingSectionId=100&rankingSeq=2<\/p>\n<p>    .<br \/>\n    .<\/p>\n<p>#5 \u6587\ub300\ud1b5\ub839 \ubc1c\uc5b8\uc5d0 \ub4a4\uc9d1\uc5b4\uc9c4 \u2018\uc815\uc2dc \ud655\ub300\u2019\u2026\u201c\uc870\uad6d \uc0ac\ud0dc\uac00 \uad50\uc721\u2026<br \/>\n\/main\/ranking\/read.nhn?mid=etc&sid1=111&rankingType=popular_day&oid=020&aid=0003248596&date=20191022&type=1&rankingSectionId=100&rankingSeq=5<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python\uc744 \uc774\uc6a9\ud574 \uc6f9 \ud398\uc774\uc9c0\uc5d0\uc11c \uc6d0\ud558\ub294 \uc815\ubcf4\ub97c \ucd94\ucd9c\ud574 \ub0b4\ub294 \ucf54\ub4dc\ub2e4. \uc544\ub798\ub294 \ub124\uc774\ubc84 \ub274\uc2a4\uc758 \uc624\ub298 \ub0a0\uc9dc\uc5d0 \ub300\ud55c \ud1a0\ud53d \uc81c\ubaa9\uacfc \ud574\ub2f9 url\uc744 \ubf51\uc544\ub0b4\ub294 \ucf54\ub4dc \uc608\uc81c. import requests from bs4 import BeautifulSoup url = &#8216;https:\/\/news.naver.com\/main\/ranking\/popularDay.nhn?rankingType=popular_day&#038;date=20191022&#8217; r = requests.get(url) html = r.content soup = BeautifulSoup(html, &#8216;html.parser&#8217;) titles_html = soup.select(&#8216;.ranking_section > ol > li > dl > dt > a&#8217;) for &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=8307\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;\uc6f9 \ud06c\ub864\ub9c1&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[131],"tags":[],"class_list":["post-8307","post","type-post","status-publish","format-standard","hentry","category-python"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/8307","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8307"}],"version-history":[{"count":13,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/8307\/revisions"}],"predecessor-version":[{"id":9544,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/8307\/revisions\/9544"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8307"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}