由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - cookie的问题
相关主题
同主题转寄 (转载)which header file declares ntohs() in c++ ?
python 超级难题求救HTTP Error 403
这个简单的post.py怎么不work请教个wget获取要密码登录的http页面的问题
python大牛请进有问题求教谁能说说Perl, Python, Tcl各自的优缺点?主要应用场合?
Python macro questionGNUPLOT怎么样画大小不同的点
菜鸟求助:怎么自动include header file?花了一个小时学习了python
url header问题how to decode these data from users' input at a web site
ask a question about compile shared library using libtool这里的人用BOOST都是用来做什么?
相关话题的讨论汇总
话题: page话题: data话题: galx话题: headers话题: request
进入Programming版参与讨论
1 (共1页)
d********1
发帖数: 3828
1
最近在研究googlevoice python script。
这个script是用来登录google voice的。现在用这个script总是出错,似乎是因为不支
持cookie。
比较关键的几行是
content = self.__do_page('login').read()
# holy hackjob
galx = re.search(r"name="GALX"\s+value="(.+)"", content).group(1)
self.__do_page('login', {'Email': email, 'Passwd': passwd, 'GALX':
galx})
这里面'login'是https://www.google.com/accounts/ServiceLoginAuth?service=
grandcentral
do page的定义是
def __do_page(self, page, data=None, headers={}):
"""
Loads a page out of the settings and pass it on to urllib Request
"""
page = page.upper()
if isinstance(data, dict) or isinstance(data, tuple):
data = urlencode(data)
headers.update({'User-Agent': 'PyGoogleVoice/0.5'})
if log:
log.debug('%s?%s - %s' % (getattr(settings, page)[22:], data or
'', headers))
if page in ('DOWNLOAD','XML_SEARCH'):
return urlopen(Request(getattr(settings, page) + data, None,
headers))
if data:
headers.update({'Content-type': 'application/x-www-form-
urlencoded;charset=utf-8'})
return urlopen(Request(getattr(settings, page), data, headers))
有高手能帮我看看怎么回事么?谢谢。
d********1
发帖数: 3828
2
我看了https://www.google.com/accounts/ServiceLoginAuth?service=
grandcentral
的源码,比较困惑的一点是这个页面并没有set-cookie。对cookie不太明白,请问
browser是怎样知道那些是cookie的呢?

【在 d********1 的大作中提到】
: 最近在研究googlevoice python script。
: 这个script是用来登录google voice的。现在用这个script总是出错,似乎是因为不支
: 持cookie。
: 比较关键的几行是
: content = self.__do_page('login').read()
: # holy hackjob
: galx = re.search(r"name="GALX"\s+value="(.+)"", content).group(1)
: self.__do_page('login', {'Email': email, 'Passwd': passwd, 'GALX':
: galx})
: 这里面'login'是https://www.google.com/accounts/ServiceLoginAuth?service=

A**u
发帖数: 2458
3
大牛
帮你顶

【在 d********1 的大作中提到】
: 最近在研究googlevoice python script。
: 这个script是用来登录google voice的。现在用这个script总是出错,似乎是因为不支
: 持cookie。
: 比较关键的几行是
: content = self.__do_page('login').read()
: # holy hackjob
: galx = re.search(r"name="GALX"\s+value="(.+)"", content).group(1)
: self.__do_page('login', {'Email': email, 'Passwd': passwd, 'GALX':
: galx})
: 这里面'login'是https://www.google.com/accounts/ServiceLoginAuth?service=

l****g
发帖数: 1922
4
我记得通过这个链接登陆google,需要在 header里面加信息
你再看看
l****g
发帖数: 1922
5
好像是不用cookie, 你登陆完以后 页面里面会有个认证码
把认证码加到header里去 就行了
l****g
发帖数: 1922
6
{'User-Agent': 'PyGoogleVoice/0.5'}
这个可能换成别的好一点
d********1
发帖数: 3828
7
我用firefox登录google voice,并且用firebug查看,我看就是post了一些信息。而我
用python script同样post这些信息就登录不上。不知为什么。
n*w
发帖数: 3393
8
程序登入Google voice有什么用处?好奇问一下
l****g
发帖数: 1922
9
可以自动发短信 定时发短信  大量发短信
我就能想这么多 :D
1 (共1页)
进入Programming版参与讨论
相关主题
这里的人用BOOST都是用来做什么?Python macro question
sucks (转载)菜鸟求助:怎么自动include header file?
3sum problemurl header问题
[合集] 我也花了一小时读了一下pythonask a question about compile shared library using libtool
同主题转寄 (转载)which header file declares ntohs() in c++ ?
python 超级难题求救HTTP Error 403
这个简单的post.py怎么不work请教个wget获取要密码登录的http页面的问题
python大牛请进有问题求教谁能说说Perl, Python, Tcl各自的优缺点?主要应用场合?
相关话题的讨论汇总
话题: page话题: data话题: galx话题: headers话题: request