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

登录到需要使用python的javascript的网站,python,login,request,Python,Login,Request,我正在尝试登录此网站/浏览器游戏。我已经搜索了一段时间,尝试了不同的模块,但到目前为止我还没有成功 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. w

我正在尝试登录此网站/浏览器游戏。我已经搜索了一段时间,尝试了不同的模块,但到目前为止我还没有成功

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代码看起来好像失败了。。有人知道我做错了什么吗?

你没有发送他们期望的所有正确参数。他们期望的不仅仅是用户/通行证

下面是我在Delphi中使用的一些参数代码

  PostData.Add('name='+Username);
  PostData.Add('password='+Password);
  PostData.Add('s1='+'login');
  PostData.Add('w='+'1440:900'); //mod'd for example 
  PostData.Add('login='+'1398184793'); // mod'd for example

您没有发送他们期望的所有正确参数。他们期望的不仅仅是用户/通行证

下面是我在Delphi中使用的一些参数代码

  PostData.Add('name='+Username);
  PostData.Add('password='+Password);
  PostData.Add('s1='+'login');
  PostData.Add('w='+'1440:900'); //mod'd for example 
  PostData.Add('login='+'1398184793'); // mod'd for example

你得到了什么回应?你期待什么?查看返回的html,它是相同的登录屏幕。比如说,如果你试图访问一个包含必需帐户信息的链接,我会要求你先登录。你会得到什么样的响应?你期待什么?查看返回的html,它是相同的登录屏幕。例如,如果您试图转到包含所需帐户信息的链接,我会要求您先登录。旁注:如果您仍在播放,请在哪台服务器上?:)旁注:如果你仍然玩,在哪台服务器上?:)