[파이썬]Beautifulsoup 이용 xml 파씽(기상청 육상 중기예보)
# 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)..

image