Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- from bs4 import BeautifulSoup
- html = requests.get('https://www.naver.com/').text
- soup = BeautifulSoup(html, 'html.parser')
- #print(soup)
- title_list = soup.select('.PM_CL_realtimeKeyword_rolling span[class*=ah_k]')
- for idx, title in enumerate(title_list, 1):
- print("{}{} {}".format(idx, '위', title.text))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement