소개
호기심을 잃지 않는 어른이 되고 싶은 지소라입니다 |ૂ•ᴗ•⸝⸝)”
강의
전체1수강평
게시글
질문&답변
2020.04.28
이렇게 코딩했더니
import sys import io import urllib.request as req from bs4 import BeautifulSoup import os.path #os.path 내에는 경로반환, 경로추출 등 파일/디렉토리 경로와 관련된 많은 함수를 제공해준다. sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding = 'utf-8') sys.stderr = io.TextIOWrapper(sys.stderr.detach(), encoding = 'utf-8') #다운로드 urll url = "http://www.weather.go.kr/weather/lifenindustry/sevice_rss.jsp" savename = "c:/section4/forecast.xml" if not os.path.exists(savename): req.urlretrieve(url, savename) #BeautifulSoup 파싱 xml = open(savename, 'r', encoding="utf-8").read() soup = BeautifulSoup(xml, 'html.parser') #지역확인 for location in soup.find_all("location"): loc = location.find("city").string print(loc) 이렇게 적었어요
- 0
- 3
- 217
질문&답변
2020.03.31
강의내용과 관련 없는 질문드립니다.
안녕하세요 기효님! 저도 찾아보다가 어떤분이 쓰신 글에서 refs를 권장하지 않는다는 말을 보고 사실 굉장히 의아했었거든요. refs를 권장하는 걸로 아는데 쓰지 말라고 하니.... 물론 믿을만한 출처인지는 모르겠지만 말이죠. 이 글에 있어요. https://devriver.tistory.com/31 이분이 참고로 남겨주신 원문글에 따르면 사실 이 원문글에서도 queryselector보다 refs가 훨씬 간결하기 때문에 refs를 권장하고 있는데, 제가 첨부한 글이 vue refs라고 검색하면 상위에 떠서, 아직 개념이 확실하지 않은 분들께(저도 한때.....ㅎㅎㅎ) 혼란을 주는것 같습니다
- 1
- 2
- 150