|
http://www.hackerschool.org/HS_Boards/zboard.php?AllArticle=true&no=6577 [º¹»ç]
import requests
from bs4 import BeautifulSoup
def spy(max_pages):
page = 1
while page < max_pages:
url = 'http://news.naver.com/main/main.nhn?mode=LSD&mid=shm&sid1=101' + str(page)
source_code = requests.get(url)
happy_text = source_code.text
soup = BeautifulSoup(happy_text, 'lxml')
for link in soup.select('dt > a#1063253_49479972'):
href = "http://news.naver.com/main/main.nhn?mode=LSD&mid=shm&sid1=101" +link.get('href')
title = link.string
print(href)
print(title)
page += 1
spy(2)
ÆÄÀ̽ã Å©·Ñ·¯ ¸¸µé¾î º¸¾Ò´Âµ¥ ¾ÈµÇ³×¿ä ¸Ó°¡¹®Á¦ÀÎÁö ¾Æ½Ã´ÂºÐ ¤Ð¤Ð |
Hit : 4410 Date : 2017/04/29 11:55
|