试图张贴一个登录到一个网站,但似乎无法使它发挥作用。
以下是返回的错误:
<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>cloudflare-nginx</center>
</body>
下面是我试图将登录请求发布到的表单:
<form name="loginform" id="loginform" method="post" action="login.php" onsubmit="return formVal();">
<table cellpadding="2" cellspacing="1" border="0" align="center">
<tr valign="top">
<td align="right">Username </td>
<td align="left"><input type="text" name="username" id="username" class="inputtext" autofocus="autofocus" /></td>
</tr>
<tr valign="top">
<td align="right">Password </td>
<td align="left"><input type="password" name="password" id="password" class="inputtext" /></td>
</tr>
<tr valign="top">
<td colspan="2" align="right"><input type="checkbox" name="keeplogged" value="1" />Keep me logged in</td>
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" name="login" value="Log In!" class="submit" /></td>
</tr>
</table>
<br /><br />
Lost your password? <a href="login.php?act=recover">Recover it here!</a>
救命啊!
发布于 2015-06-10 07:03:49
试着先得到页面,然后发布,就像这样-
with cfscrape.create_scraper() as s:
p = s.get(login_url)
p = s.post(login_url, data=payload)
print p.content
https://stackoverflow.com/questions/30748365
复制相似问题