![[파이썬]Beautifulsoup 이용 xml 파씽(기상청 육상 중기예보)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FzoFAp%2FbtrUKXB3cji%2FZYJ4IQ0vNaEOkYUXKjyTvK%2Fimg.png)
# Script/Python2022. 12. 28. 12:59[파이썬]Beautifulsoup 이용 xml 파씽(기상청 육상 중기예보)
from bs4 import BeautifulSoup import urllib.request as MyURL japi = 'http://www.kma.go.kr/weather/forecast/mid-term-rss3.jsp?stnId=109' response = MyURL.urlopen(japi) weather = BeautifulSoup(response, "html.parser") for location in weather.findAll('location'): print(location.city.string) print("="*20) for data in location.findAll('data'): print("시간:",data.tmef.string) print("날씨:",data.wf.string)..