반응형
from urllib.request import urlopen
from bs4 import BeautifulSoup
html = urlopen('http://www.naver.com/')
bsObject = BeautifulSoup(html,"html.parser")
title_list = bsObject.select('.PM_CL_realtimeKeyword_rolling .ah_k')
for i, title in enumerate(title_list):
print(i+1, ":" , title.get_text())
반응형
'python' 카테고리의 다른 글
| [python] no support pyautogui.typewrite('UNICODE like 한글') (0) | 2019.08.18 |
|---|---|
| [python] crawling method by partial ids (0) | 2019.08.15 |
| [python] for using cv2 (0) | 2019.08.12 |
| [python] ModuleNotFoundError: No module named 'pip' (0) | 2019.08.11 |
| [python - openpyxl] check Excel empty value (0) | 2019.08.04 |