我一直试图自动登录到特定的网页,但至今没有成功。
我真的很感激你能帮我搬家.
这是登录页面的URL:
https://www.cellcom.co.il/login/pages/default.aspx
第一个字段用于用户名,第二个字段用于密码。
我一直在使用Live头插件,但没有成功登录。
谢谢。
我快把这事搞垮了。我计算出一个POST表单字段作为嵌入部分值,它会动态变化。所以,我需要做的就是得到这个嵌入的部分值,并向它添加一些静态文本。以获得完整的字段值。
如何获得POST表单字段值?(我在查看表单源代码时看到了这个值)
我还注意到在末尾有一个小字符串,它会动态地变化
下面是该字符串的一个示例:
1)__EVENTVALIDATION=%2FwEWBQLh6fTmCwLEh%2FPQBQLquryWCwLdkfOzBAKJwsCnBDoiuyJEoeA1mA05RcQwJ0YqLNx4
2)__EVENTVALIDATION=%2FwEWBQLj%2BKPzBgLEh%2FPQBQLquryWCwLdkfOzBAKJwsCnBELoi3vgs%2BqAdCbcwk%2BkyCQwEq30
有人知道如何生成这个字符串吗?是和约会有关还是类似的?
谢谢
编辑:所有动态值都嵌入到HTTP源文件中。是否可以轻松地使用PHP解析这些值?如果是这样的话,是怎么做的?
发布于 2010-01-15 20:37:25
还是没有成功。我想我错过了一些微小的细节。
这是邮寄表格:
表格name="aspnetForm“method=后”action="default.aspx“id="aspnetForm”autocomplete=off“
输入type=“隐藏”name="__SPSCEditMenu“id="__SPSCEditMenu”__SPSCEditMenu“true”/输入type=隐藏“name="MSOWebPartPage_PostbackSource”id="MSOWebPartPage_PostbackSource“value=”/ input type=“隐藏”name="MSOTlPn_SelectedWpId“id="MSOTlPn_SelectedWpId”value=“input”隐藏“”“0”
输入type=“隐藏”type=“name="MSOTlPn_ShowSettings”id="MSOTlPn_ShowSettings“value=”隐藏“type=”隐藏“name="MSOGallery_SelectedLibrary”id="MSOGallery_SelectedLibrary“value=”/> input type=“隐藏”name=“input”隐藏“”“none”input“隐藏”Jan 2010 19:29:23 -0000“/> input type=”隐藏“name="MSOAuthoringConsole_FormContext”id="MSOAuthoringConsole_FormContext“value="”/> input type=“隐藏”name="MSOAC_EditDuringWorkflow“id="MSOAC_EditDuringWorkflow”value=“/> input type=”隐藏“name=”value="“”#en34 20“浏览”输入“隐藏”“”en29#“隐藏”“”/>输入type=“隐藏”name="MSOLayout_InDesignMode“id="MSOLayout_InDesignMode”value=“/> input type=”隐藏“name=”MSOSPWebPartManager_OldDisplayModeName id=MSOSPWebPartManager_OldDisplayModeName“value=”浏览隐藏的“/> input type=”隐藏的“MSOLayout_InDesignMode”错误输入“隐藏”#en23“#en26
这是我使用的代码:函数http($target,$ref,$method,$data_array,$incl_head) {# Initialize /CURL handle $ch = curl_init();
# HEAD method configuration
if($method == HEAD)
{
curl_setopt($ch, CURLOPT_HEADER, TRUE); // No http head
curl_setopt($ch, CURLOPT_NOBODY, TRUE); // Return body
}
else
{
# GET method configuration
if($method == GET)
{
if(isset($query_string))
$target = $target . "?" . $query_string;
curl_setopt ($ch, CURLOPT_HTTPGET, TRUE);
curl_setopt ($ch, CURLOPT_POST, FALSE);
}
# POST method configuration
if($method == POST)
{
if(isset($data_array))
curl_setopt ($ch, CURLOPT_POSTFIELDS, $data_array);
curl_setopt ($ch, CURLOPT_POST, TRUE);
curl_setopt ($ch, CURLOPT_HTTPGET, FALSE);
}
curl_setopt($ch, CURLOPT_HEADER, $incl_head); // Include head as needed
curl_setopt($ch, CURLOPT_NOBODY, FALSE); // Return body
}
curl_setopt($ch, CURLOPT_COOKIEJAR, COOKIE_FILE); // Cookie management.
curl_setopt($ch, CURLOPT_COOKIEFILE, COOKIE_FILE);
curl_setopt($ch, CURLOPT_TIMEOUT, CURL_TIMEOUT); // Timeout
curl_setopt($ch, CURLOPT_USERAGENT, WEBBOT_NAME); // Webbot name
curl_setopt($ch, CURLOPT_URL, $target); // Target site
curl_setopt($ch, CURLOPT_REFERER, $ref); // Referer value
curl_setopt($ch, CURLOPT_VERBOSE, FALSE); // Minimize logs
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // No certificate
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); // Follow redirects
curl_setopt($ch, CURLOPT_MAXREDIRS, 4); // Limit redirections to four
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Return in string我使用的URL是从Live表单的头文件中提取的:https://www.cellcom.co.il/siteminderagent/forms/login.fcc
你怎么想?说得通吗?
https://stackoverflow.com/questions/2071157
复制相似问题