글
파이썬을 공부하는 중에 urllib.urlopen 이라는 재밌는 친구를 가지고 노는 중입니다.
웬만한 페이지들은 해당 url의 소스를 모두 긁어와줘서 제가 원하는 데이터를 만들 수 있었습니다.
근데 학교 학식 홈페이지를 가니 웹페이지에서는 보이는데,
소스보기를 하니까 프레임 보기를 하라고 해서 프레임 보기에 있는 url을 가져왔더니 저렇게 메뉴 내용은 가져와지질 않습니다...
html을 잘 모르기도 하고.. 어떤 식으로 검색해야되는지도 잘 모르겠어서 생코 선배님들 조언 좀 구하고 싶습니다!
(정보를 주시는 데 필요하시면 학식 홈페이지 주소도 올리겠습니다..)
가만히 소스를 보면
<script type="text/javascript" src="/hyomin/pages/60/js/6050.js"></script>
이거로 ajax임
그러니까
그것을 뜯어보면
이렇게 ajax로 가져옴
function getWeeklyMenu() { rolesControl(); var parameters = "locgbn=" + global_locgbn + "&sch_date=" + sch_date; KH_getAjax("/hyomin/food/getWeeklyMenu.kmc", parameters, resultWeeklyMenu); }
#-*- coding: utf-8 -*-import requestsimport jsonr = requests.post("https://dorm.deu.ac.kr/hyomin/food/getWeeklyMenu.kmc", params={'locgbn': 'DE', 'sch_date' : '2016-12-30'})js = json.loads(r.text)menus = js['root'][0]['WEEKLYMENU'][0]for i in range(1, 8):print "날짜 :", menus["fo_date" + str(i)]print "조식 :", menus["fo_menu_mor" + str(i)]print "중식 :", menus["fo_menu_lun" + str(i)]print "석식 :", menus["fo_menu_eve" + str(i)]print ""
이렇게 가져와봄
그러면 json을 아래와 같이 가져옴
그러니까 parsing하면 원하는 값을 가져옴
{u'root': [{u'LASTNEXT': [{u'go': u'next_mon'}, {u'go': u'last_mon', u'mon_date': u'2016-12-26'}], u'WEEKLYMENU': [{u'seq': 36, u'fo_menu_lun3': u'\uc1e0\uace0\uae30\ucf69\ub098\ubb3c\ubc25/\uc591\ub150\uc7a5, \uadfc\ub300\uad6d, \uc5b8\uc591\ubc14\uc2f9\ubd88\uace0\uae30/\ud30c\ucc44, \uc544\uc0ad\uace0\ucd94\ub41c\uc7a5\ubb34\uce68, \uae40\uce58/\uc22d\ub289', u'fo_menu_lun2': u'\uc0c8\uc54c\ubbf8\uc5ed\uad6d, \uc870\uae30\uad6c\uc774, \uc81c\uc721\uc7a1\ucc44, \uc624\uc774\uc591\ud30c\ubb34\uce68, \uae40\uce58, \uc22d\ub289', u'fo_menu_lun1': u'\uc1e0\uace0\uae30\ud574\uc7a5\uad6d, \ub3c8\ub450\ub8e8\uce58\uae30, \uacfc\uc77c\uc0ac\ub77c\ub2e4, \uc5f4\ubb34\ub41c\uc7a5\ub098\ubb3c, \uae4d\ub450\uae30, \uc22d\ub289', u'fo_menu_lun7': u'(1\uad00 \uc5c6\uc74c) \uc1e0\uace0\uae30\ub5a1\uad6d(\ud589\ubcf5, 2\uad00), \uccad\ud30c\ub798\uc624\uc9d5\uc5b4\uae4c\uc2a4/\uba38\uc2a4\ud0c0\ub4dc(\ud589\ubcf5, 2\uad00), \uc6b0\ub3d9\uad74\uc18c\uc2a4\ubcf6\uc74c(\ud589\ubcf5, 2\uad00), \ub3c4\ub77c\uc9c0\ucc44\uc624\uc774\ubb34\uce68(\ud589\ubcf5, 2\uad00), \uae40\uce58(\ud589\ubcf5, 2\uad00)', u'fo_menu_lun6': u'\ub77c\uba74(1\uad00), \uc870\uac2f\uc0b4\ubbf8\uc5ed\uad6d(\ud589\ubcf5,2\uad00), \ub2ed\ubcf6\uc74c\ud0d5(\ud589\ubcf5, 2\uad00), \ud478\uc2e4\ub9ac\uac74\ud3ec\ub3c4\ubc94\ubc85(\ud589\ubcf5,2\uad00), \ub9c8\ub298\ucad1\ub77d\uad50\ubb34\uce68(\ud589\ubcf5,2\uad00), \uae40\uce58(\ud589\ubcf5,2\uad00)', u'fo_menu_lun5': u'\uc721\uac1c\uc7a5, \ub099\uc9c0\ubcf6\uc74c/\uc18c\uba74\uc0ac\ub9ac, \uc54c\uac10\uc790\ubc84\ud130\uad6c\uc774, \ud33d\uc774\ubc84\uc12f\ubbf8\uc5ed\uc904\uae30\ubcf6\uc74c, \uae40\uce58, \uc22d\ub289', u'fo_menu_lun4': u'\ubd81\uc5b4\uacc4\ub780\uad6d, \ud0d5\uc218\uc721/\ud0d5\uc218\uc18c\uc2a4, \uce74\ub808\ub5a1\ubcf6\uc774, \ub2e8\ubc30\ucd94\uac89\uc808\uc774, \uae4d\ub450\uae30, \uc22d\ub289', u'fo_menu_eve7': u'(1\uad00 \uc5c6\uc74c) \ub4e4\uae68\uc2dc\ub77d\uad6d(\ud589\ubcf5, 2\uad00), \uc911\uc2dd\ub3fc\uc9c0\uace0\uae30\uac00\uc9c0\ubcf6\uc74c(\ud589\ubcf5, 2\uad00), \ud0d5\ud3c9\ucc44(\ud589\ubcf5, 2\uad00), \uc2dc\uae08\uce58\ub098\ubb3c(\ud589\ubcf5, 2\uad00)', u'fo_menu_mor2': u'\ucc38\uce58\ub9e4\uc6b4\ud0d5, \uace0\ucd94\uc7a5\ub08f\uc78e\ubd88\uace0\uae30, \uc5f0\ub450\ubd80/\uc591\ub150\uac04\uc7a5, \ud638\ubc15\uc0c8\uc6b0\uc813\ub098\ubb3c, \uae4d\ub450\uae30', u'fo_menu_mor3': u'\uc0c8\uc6b0\ub41c\uc7a5\ucc0c\uac1c, \ub3c8\uaf48\ub9ac\ucd08\uc7a5\uc870\ub9bc, \ubcfc\uc5b4\ubb35\uace0\ucd94\uc7a5\uc870\ub9bc, \ucc38\ub098\ubb3c\ubb34\uce68, \uae40\uce58', u'fo_menu_mor1': u'\ubaa8\ub4ec\uc5b4\ubb35\uad6d, \ubbf8\ud2b8\ubcfc\ud3ed\ucc39, \uacc4\ub780\ud6c4\ub77c\uc774, \ube0c\ub85c\uceec\ub9ac/\ucd08\uc7a5, \uae40\uce58', u'fo_menu_mor6': u'(\ud589\ubcf5\xb72\uad00 \uc5c6\uc74c) \uadfc\ub300\uad6d(1\uad00), \uc624\uc9d5\uc5b4\uc57c\ucc44\ubcf6\uc74c(1\uad00), \ube44\uc5d4\ub098\uac04\uc7a5\uc870\ub9bc(1\uad00), \ub2e4\uc2dc\ub9c8\ucc44\uc813\uac08\ubb34\uce68(1\uad00), \uae40\uce58(1\uad00)', u'fo_menu_mor7': u'(\ud589\ubcf5\xb71\uad00\xb72\uad00 \uc5c6\uc74c) ', u'fo_menu_mor4': u'\uae40\uce58\ucc0c\uac1c, \uc2a4\ud338\uad6c\uc774, \ub290\ud0c0\ub9ac\ub9db\uc0b4\ubcf6\uc74c, \ub41c\uc7a5\uae7b\uc78e\uc9c0, \uae4d\ub450\uae30', u'fo_menu_mor5': u'\uc1e0\uace0\uae30\ubb34\ud0d5\uad6d,\uac08\uce58\ubb34\uc870\ub9bc, \uc2a4\ud06c\ub7a8\ube14\uc5d0\uadf8, \uc219\uc8fc\ubbf8\ub098\ub9ac\ub098\ubb3c, \uae40\uce58, \uc694\ud50c\ub808', u'fo_menu_eve4': u'\ud050\ube0c\ucc38\uce58\uc57c\ucc44\ube44\ube54\ubc25, \ub9d1\uc740\ucf69\ub098\ubb3c\uad6d, \ub5a1\uac08\ube44\ub370\ub9ac\uc57c\ub07c\uc870\ub9bc, \uc794\uba78\uce58\uc544\ubaac\ub4dc\ubcf6\uc74c, \uae40\uce58/\ub9dd\uace0\uc96c\uc2a4', u'fo_date4': u'2016-12-29', u'fo_date5': u'2016-12-30', u'fo_date6': u'2016-12-31', u'fo_date7': u'2017-01-01', u'fo_menu_eve2': u'\uce58\ud0a8\uce58\uc988\uae4c\uc2a4, \uc591\uc1a1\uc774\ud06c\ub9bc\uc2a4\ud504, \uadf8\ub9b0\uc0d0\ub7ec\ub4dc/\ub4dc\ub808\uc2f1, \uc6e8\uc9c0\uac10\uc790, \uae40\uce58/\uc96c\uc2dc\ucfe8', u'fo_menu_eve3': u'\ubd80\ub300\ucc0c\uac1c, \uc18c\ubd88\uace0\uae30, \uc625\uc218\uc218\ucf58\uce58\uc988\uad6c\uc774, \ubd80\ucd94\uac89\uc808\uc774, \uae40\uce58, \ub808\ubaac\ucc28', u'fo_date2': u'2016-12-27', u'fo_date3': u'2016-12-28', u'today': u'2016-12-30', u'fo_date1': u'2016-12-26', u'locgbn': u'DE', u'fo_menu_eve1': u'\ubc84\uc12f\ucc0c\uac1c, \ucda9\ubb34\uc2dd\uc624\uc9d5\uc5b4\ubb34\uce68, \uccad\ub7c9\ubd80\ucd94\uc804/\uac04\uc7a5, \ucf69\ub098\ubb3c\ubb34\uce68, \uae40\uce58, \ucf54\ucf54\uc544', u'fo_menu_eve5': u'\uaf43\uac8c\ud0d5, \ub9c8\ud30c\ub450\ubd80, \ud574\ubb3c\uacbd\ub2e8\uc804/\ucf00\ucc39, \ube44\ud2b8\ubb34\uc0dd\ucc44, \uae40\uce58, \uade4', u'fo_menu_eve6': u'\uc21c\ub450\ubd80\ucc0c\uac1c, \ucf54\ub2e4\ub9ac\ucf69\ub098\ubb3c\ucc1c, \uba54\ub780\uace4\uc57d\uc870\ub9bc, \uccad\uacbd\ucc44\uac89\uc808\uc774, \uae4d\ub450\uae30'}]}]} 날짜 : 2016-12-26 조식 : 모듬어묵국, 미트볼폭찹, 계란후라이, 브로컬리/초장, 김치 중식 : 쇠고기해장국, 돈두루치기, 과일사라다, 열무된장나물, 깍두기, 숭늉 석식 : 버섯찌개, 충무식오징어무침, 청량부추전/간장, 콩나물무침, 김치, 코코아 날짜 : 2016-12-27 조식 : 참치매운탕, 고추장낏잎불고기, 연두부/양념간장, 호박새우젓나물, 깍두기 중식 : 새알미역국, 조기구이, 제육잡채, 오이양파무침, 김치, 숭늉 석식 : 치킨치즈까스, 양송이크림스프, 그린샐러드/드레싱, 웨지감자, 김치/쥬시쿨 날짜 : 2016-12-28 조식 : 새우된장찌개, 돈꽈리초장조림, 볼어묵고추장조림, 참나물무침, 김치 중식 : 쇠고기콩나물밥/양념장, 근대국, 언양바싹불고기/파채, 아삭고추된장무침, 김치/숭늉 석식 : 부대찌개, 소불고기, 옥수수콘치즈구이, 부추겉절이, 김치, 레몬차 날짜 : 2016-12-29 조식 : 김치찌개, 스팸구이, 느타리맛살볶음, 된장깻잎지, 깍두기 중식 : 북어계란국, 탕수육/탕수소스, 카레떡볶이, 단배추겉절이, 깍두기, 숭늉 석식 : 큐브참치야채비빔밥, 맑은콩나물국, 떡갈비데리야끼조림, 잔멸치아몬드볶음, 김치/망고쥬스 날짜 : 2016-12-30 조식 : 쇠고기무탕국,갈치무조림, 스크램블에그, 숙주미나리나물, 김치, 요플레 중식 : 육개장, 낙지볶음/소면사리, 알감자버터구이, 팽이버섯미역줄기볶음, 김치, 숭늉 석식 : 꽃게탕, 마파두부, 해물경단전/케찹, 비트무생채, 김치, 귤 날짜 : 2016-12-31 조식 : (행복·2관 없음) 근대국(1관), 오징어야채볶음(1관), 비엔나간장조림(1관), 다시마채젓갈무침(1관), 김치(1관) 중식 : 라면(1관), 조갯살미역국(행복,2관), 닭볶음탕(행복, 2관), 푸실리건포도범벅(행복,2관), 마늘쫑락교무침(행복,2관), 김치(행복,2관) 석식 : 순두부찌개, 코다리콩나물찜, 메란곤약조림, 청경채겉절이, 깍두기 날짜 : 2017-01-01 조식 : (행복·1관·2관 없음) 중식 : (1관 없음) 쇠고기떡국(행복, 2관), 청파래오징어까스/머스타드(행복, 2관), 우동굴소스볶음(행복, 2관), 도라지채오이무침(행복, 2관), 김치(행복, 2관) 석식 : (1관 없음) 들깨시락국(행복, 2관), 중식돼지고기가지볶음(행복, 2관), 탕평채(행복, 2관), 시금치나물(행복, 2관) Process finished with exit code 0
글
gvim vim tab
\HKEY_CLASSES_ROOT\Applications\gvim.exe\shell\edit\command
항목을 열어서 "기본값" 수정에서
"C:\Program Files (x86)\Vim\vim73\gvim.exe" "%1"
'Local Setting' 카테고리의 다른 글
Touch cursor - Windows keyboard binding like vi vim (0) | 2011.12.22 |
---|---|
vim win 로컬세팅 (0) | 2011.12.15 |