我想自动登录网站(带有cookie的POST),然后填写几个表格。
1 /我尝试使用curl来做,但我不确定是否可行。至少我没有设法使用
来做到这一点curl --cookie mycookie.txt --data "login=mylogin&password=mypassword&Button=Login" [the url of the website]
'' 编辑 '' 这是curl命令的结果(包括标题--include):
Content-Type: text/html
Server: Microsoft-IIS/6.0
X-Powered-By: PHP/5.2.6
Set-Cookie: PHPSESSID=b865a8e357d4f945e576aebe4f288320; path=/
Set-Cookie: cookiename=deleted; expires=Wed, 14-Jul-2010 06:43:26 GMT
X-Powered-By: PleskWin
X-Powered-By: ASP.NET
Date: Thu, 14 Jul 2011 06:43:26 GMT
Connection: close
<html>
<head>
<title>:: Welcome ::</title>
<link rel="stylesheet" type="text/css" href="Styles/textset.css">
<script language="JavaScript" type="text/javascript">
//Begin CCS script
//Include Common JSFunctions @1-252A7665
</script>
<script language="JavaScript" src="ClientI18N.php?file=Functions.js&locale=en" type="text/javascript" charset="utf-8"></script>
<script language="JavaScript" src="HeaderFunctions.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
//End Include Common JSFunctions
//_OnLoad @1-9C4F01C0
function _OnLoad()
{
var result = true;
//End _OnLoad
//Set Focus @23-D20FE9BF
if (document.forms["Login"] && document.forms["Login"].login) document.forms["Login"].login.focus();
//End Set Focus
//Close _OnLoad @1-BC33A33A
return result;
}
//End Close _OnLoad
//bind_events @1-C1F288D9
function bind_events() {
if (functionExists("header_bind_events")) header_bind_events();
if (functionExists("footer_bind_events")) footer_bind_events();
addEventHandler("", "load", _OnLoad);
}
//End bind_events
window.onload = bind_events; //Assign bind_events @1-19F7B649
//End CCS script
</script>
<link rel="stylesheet" type="text/css" href="Styles/sitename/Style.css">
</head>
...
有谁知道在加载时执行的CSS脚本是什么?这可能是我无法使用curl登录的原因吗?
我怎么知道这是因为我做错了什么,还是因为这种方法不起作用(正如我在SO上的几篇文章中读过的那样)?
2 /另一个想法是使用操作chrome(或任何浏览器)的工具使其按下不同的按钮。这种软件是否存在?
由于