Created
January 27, 2016 02:39
-
-
Save if1live/623a33003790f556516e to your computer and use it in GitHub Desktop.
확산선 밀리언 ㄹ혜
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
""" | |
pip install requests | |
""" | |
import urllib | |
import requests | |
def create_param(name, pos, addr_1, addr_2): | |
params = { | |
"NM": urllib.quote(name.encode("euc-kr")), | |
"POS": urllib.quote(pos.encode("euc-kr")), | |
"tmp_addr01": urllib.quote(addr_1.encode("euc-kr")), | |
"tmp_addr02": urllib.quote(addr_2.encode("euc-kr")), | |
} | |
return params | |
def vote(name, pos, addr_1, addr_2): | |
url = "http://www.korcham.net/main_family.jsp" | |
params = create_param(name, pos, addr_1, addr_2) | |
r = requests.post(url, data=params) | |
print(r.status_code) | |
print(r.text) | |
if __name__ == "__main__": | |
vote(u"박근혜", u"청와대", u"강원도", u"강릉시") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment