reum / pyTelegramBotAPI

Python Telegram bot api.
GNU General Public License v2.0
3 stars 3 forks source link

우산 챙기렴 기능 #6

Closed bunseokbot closed 7 years ago

bunseokbot commented 7 years ago

우산 챙기렴 기능 구현하기

reum commented 7 years ago

군자동 기상청 정보 : http://www.kma.go.kr//wid/queryDFSRSS.jsp?zone=1121573000

reum commented 7 years ago

Beautiful Soup 참고자료: http://web.stanford.edu/~zlotnick/TextAsData/Web_Scraping_with_Beautiful_Soup.html

bunseokbot commented 7 years ago

@reum

Web Scraping 할 때 Beautiful Soup 보단 간단한건 파이썬에 내장된 HTMLParser를 사용하는게 날 수도 있어요

버전대 별로 이렇게 선언할 수 있어요

Python 2.7

from HTMLParser import HTMLParser

Python 3.5

from html.parser import HTMLParser
bunseokbot commented 7 years ago

아 저거 XML 형태인데 굳이 Beautiful Soup를 사용하기보단

Python 2.x

https://docs.python.org/2/library/xml.etree.elementtree.html

Python 3.x

https://docs.python.org/3/library/xml.etree.elementtree.html

이거 쓰시면 될거같아요 데이터는 requests 나 httplib 같은 기본 모듈 사용하고

reum commented 7 years ago

헐 나 벌써 beautiful soup으로 했는데 ㅠㅠ 기본으로 하면 더 좋긴 하겠네 ㅠㅠ 나중에 시간나면 수정해야겠다.. 또륵.. 그럼 일단 다은이는 httplibs로 하는걸로... ;ㅅ;

bunseokbot commented 7 years ago

@reum requirements.txt 파일에 꼭 추가해주세요~

reum commented 7 years ago

@bunseokbot 걍 다시할라고 ㅋㅋㅋㅋㅋㅋ