import urllib
import urllib2
import cookielib
import re
#登录地址
tbLoginUrl = "https://login.taobao.com/member/login.jhtml"
checkCodeUrl = ''
#post请求头部
headers = {
'x-requestted-with': 'XMLHttpRequest',
'Accept-Language': 'zh-cn',
'Accept-Encoding': 'gzip, deflate',
'ContentType': 'application/x-www-form-urlencoded; chartset=UTF-8',
'Host': 'login.taobao.com',
'DNT': 1,
'Cache-Control': 'no-cache',
'User-Agent' : 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1',
'Referer' : 'https://login.taobao.com/member/login.jhtml?redirectURL=http%3A%2F%2Fwww.taobao.com%2F',
'Connection' : 'Keep-Alive'
}
#用户名,密码
username = "your username"
password = raw_input("Please input your password of taobao: ")
#请求数据包
postData = {
'TPL_username':username,
'TPL_password':password,
"need_check_code" : "false",
"loginsite": 0,
"newlogin":1,
'TPL_redirect_url':'',
'from':'tbTop',
'fc':"default"