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())

+ Recent posts