【发布时间】:2009-12-16 07:05:03
【问题描述】:
我正在尝试使用 Google App Engine 将我的密码和 ID 自动传递到该页面:
(这是我从这个 URL 重定向到的地方:https://signin.ebay.com)。页面如下所示:
(来源:narod.ru)
早些时候我问了一些问题,here 一位非常好的支持者建议我使用此链接中的代码:http://chillorb.com/?p=195 如果您没有时间去那里,该页面的外观如下:
(来源:narod.ru)
所以,我将该代码粘贴到我的编辑器中,替换为有效的 eBay URL、我的 ID 和密码。我的 ID 是 seeyousoondanny,密码是 happy1(我在 eBay 上创建该帐户只是为了进行实验,所以我不怕泄露我的 ID 和密码)。以下是代码在我的编辑器中的样子:
(来源:narod.ru)
但是当我运行这段代码时,我得到的只有这个:
(来源:narod.ru)
我在这里做错了什么?
++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++
加法:
这是错误页面的底部(我想如果你click on the link to this image会看得更清楚):
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++
加法:
我猜这段代码没有语法错误:
from google.appengine.api import urlfetch
import base64
url = "https://signin.ebay.com/ws/eBayISAPI.dll?SignIn&UsingSSL=1&pUserId=&co_partnerId=2&siteid=0&ru=http%3A%2F%2Fcgi5.ebay.com%2Fws2%2FeBayISAPI.dll%3FSellItem%26hm%3Dum.rundkoi376%26%26hc%3D1%26guest%3D1&pageType=1144"
authString = 'Basic' + base64.encodestring('seeyousoondanny:happy1')
data = urlfetch.fetch(url, headers= {'AUTHORIZATION' : authString })
if data.status_code == 200:
print "content-type: text/plain"
print
print data.status_code
【问题讨论】:
标签: python google-app-engine header authorization