[Python] beautiful soup 사용하기
beautiful soup 설치 (우분투 환경)$> pip install beautifulsoup4 웹페이지의 GET 데이터 정보 가져오기from bs4 import BeautifulSoupimport urllib2 try: response = urllib2.urlopen("가져올 웹페이지 주소") page = response.read().decode('cp949', 'ignore') # 인코딩 변환이 필요할 경우 response.close()except urllib2.HTTPError, e: print e.reason.args[1]except urllib2.URLError, e: print e.reason.args[1] soup = BeautifulSoup(page) 웹페이지의 GET 데이터 정보 가져..
2015.02.17