Skip to content

Instantly share code, notes, and snippets.

@codeorchord
Created October 8, 2019 17:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeorchord/626386d66d5d85662a3f702348d3bbc4 to your computer and use it in GitHub Desktop.
Save codeorchord/626386d66d5d85662a3f702348d3bbc4 to your computer and use it in GitHub Desktop.
파이썬으로 다음 실시간 이슈 검색어 크롤링하기
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)
@kimpro82
Copy link

좋은 자료 감사합니다. 너무 깔끔하게 실행 잘 되네요 ㅎ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment