ÇÁ·Î±×·¡¹Ö

 3200, 1/160 ȸ¿ø°¡ÀÔ  ·Î±×ÀΠ 
   zero1
   ÆÄÀ̽ã Äڵ尡 ¹¹°¡¹®Á¦ÀÎÁö ¤Ð¤Ð

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



    
stdcdgu lxmlµµ import ÇØÁÖ¼Å¾ß ÇÕ´Ï´Ù 2017/08/31