0
pythonスクリプトを使用してGoogle Playにログインしたいのですが、私の考えはクッキーでHTTPのrequsetを送ります。Google Playにログインするにはどうすればいいですか?
私のPythonのコードは次のようである:
import cookielib
import Cookie
import urllib2
def build_opener_with_cookie_str(cookie_str,domain,path='/'):
simple_cookie = Cookie.SimpleCookie(cookie_str);
cookiejar = cookielib.CookieJar();
for c in simple_cookie:
cookie_item = cookielib.Cookie(
version = 0, name = c, value = str(simple_cookie[c].value),
port = None, port_specified = None,
domain = domain, domain_specified = None,domain_initial_dot = None,
path = path, path_specified = None,
secure = None,
expires = None,
discard = None,
comment = None,
comment_url = None,
rest = None,
rfc2109 = False,
);
cookiejar.set_cookie(cookie_item);
return urllib2.build_opener(urllib2.HTTPCookieProcessor(cookiejar));
if __name__ == '__main__':
cookie_str = 'My Cookie str look from Chrome Request Headers cookie';
opener = build_opener_with_cookie_str(cookie_str,domain='https://play.google.com/store/apps/collection/topselling_free');
html_doc = opener.open('https://play.google.com/store/apps/collection/topselling_free').read();
print html_doc;
しかし、Google Playの応答は、ログイン結果ではありません。 私のPythonコードで何が問題になっていますか?それとも、クッキーを使うのが間違った方法でした。