반응형 파이썬크롤링1 [파이썬][기초][크롤링]BeautifulSoup 을 이용하여 기상청 스크래핑 BeautifulSoup 을 이용하여 기상청 스크래핑 ㅁ 필수 설치 패키지 1) BeautifulSoup 설치 - 명령어 : pip3 install BeautifulSoup ㅁ 소스코드 - 복사해서 실행 가능합니다. # 라이브러리 읽기 from bs4 import BeautifulSoup import urllib.request as req # 기상청 URL url = 'http://www.kma.go.kr/weather/forecast/mid-term-rss3.jsp' # URL OPEN으로 데이터 가져오기 res = req.urlopen(url) #beautifulsoup 으로 분석 soup = BeautifulSoup(res, 'html.parser') #원하는 데이터 추출 title = soup.f.. 2018. 10. 26. 이전 1 다음