Error: Post Request in Python

Error: Post Request in Python

我正在尝试登录 http://site24.way2sms.com/content/index.html

这是我写的脚本。

import urllib
import urllib2

url = 'http://site21.way2sms.com/content/index.html'
values = {'username' : 'myusername',
          'password' : 'mypassword'}

headers = {'Accept':'*/*',
            'Accept-Encoding':'gzip, deflate, sdch',
            'Accept-Language':'en-US,en;q=0.8',
            'Cache-Control':'max-age=0',
            'Connection':'keep-alive',
            'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
            'If-Modified-Since':'Fri, 13 Nov 2015 17:47:23 GMT',
            'Referer':'https://packetforger.wordpress.com/2013/09/13/changing-user-agent-in-python-requests-and-requesocks-and-using-it-in-an-exploit/',
            'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36'}


data = urllib.urlencode(values)
req = urllib2.Request(url, data, headers=headers)
response = urllib2.urlopen(req)
the_page = response.read()
print the_page

我正在从网站上收到回复。但它有点加密或类似的东西:

��:�����G��ʯ#��C���G�X�*�6�?���ך��5�\���:�tF�D1�٫W��<�bnV+w\���q�����$�Q��͇���Aq`��m�*��Օ���)���)�

在我的 ubuntu 终端中。我怎样才能解决这个问题 ? 我是否正确登录? 请帮忙。

该页面上的表单不会 post 返回到相同的 URL,它 post 返回到 http://site21.way2sms.com/content/Login.action