登录网站,需要使用python的javascript

时间:2015-08-19 19:38:05

标签: python login request

我正在尝试登录此网站/ browsergame Travian login。我一直在寻找一段时间,尝试过不同的模块,但到目前为止我还没有成功......

import requests

# Fill in your details here to be posted to the login form.
payload = {
'name': 'username',
'password': 'password'
}

# Use 'with' to ensure the session context is closed after use.
with requests.Session() as s:
p = s.post('http://ts8.travian.com/dorf1.php', data=payload)
# print the html returned or something more intelligent to see if it's a     successful login page.
print(p.text)

# An authorised request.
r = s.get('http://ts8.travian.com/statistiken.php')
print(r.text)
    # etc...

当它打印出r.text时,html代码看起来像是失败了......有人看到我做错了吗?

0 个答案:

没有答案