Created
October 8, 2019 17:31
-
-
Save codeorchord/626386d66d5d85662a3f702348d3bbc4 to your computer and use it in GitHub Desktop.
파이썬으로 다음 실시간 이슈 검색어 크롤링하기
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import requests | |
daum_url = "https://www.daum.net" | |
html = requests.get(daum_url).text | |
soup = BeautifulSoup(html, 'html.parser') | |
elem_list = soup.select(".list_mini .rank_cont .link_issue") | |
# 실시간 이슈 검색어만 추출 | |
searchword_list = [] | |
for elem in elem_list: | |
searchword_list.append(elem.get_text()) | |
# 결과 확인 | |
for searchword in searchword_list: | |
print(searchword) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
좋은 자료 감사합니다. 너무 깔끔하게 실행 잘 되네요 ㅎ