帮忙看看这个网页怎么提交……已解决
本帖最后由 lsb968 于 2013-8-22 04:00 编辑网页地址:https://passport.csdn.net/account/login
网页源码如下:
<form name="logform" action="#">
<table cellspacing="8">
<tr>
<td width="70">帐 号:</td>
<td><input type="text" id="u" name="u" class="inputbox" maxlength="50" placeholder="邮箱/用户名" /></td>
</tr>
<tr>
<td>密 码:</td>
<td><input type="password" id="p" class="inputbox" maxlength="50" /></td>
</tr>
<tr>
<td></td>
<td><input type="checkbox" id="chkRemember" name="chkRemember" style="vertical-align:middle" class="checkbox" /><label for="chkRemember" class="font_red">记住我一周</label></td>
</tr>
<tr>
<td></td>
<td>
<a id="aLogin" class="btn_login" href="javascript:void(0);"><span>登 录</span></a>
试了三种方法都不行……
;第一种
#include <IE.au3>
$oIE = _IECreate ("https://passport.csdn.net/account/login",0,1,1,0)
_IEPropertySet ($oIE, "width", 800)
_IEPropertySet ($oIE, "height", 600)
$oForm = _IEFormGetObjByName ($oIE, "logform")
$oQuery =_IEGetObjById($oForm, "u")
_IEFormElementSetValue ($oQuery,''XXXXXX")
$oQuery = _IEGetObjById($oForm, "p")
_IEFormElementSetValue ($oQuery, ''XXXXX')
$oIE.document.getElementsByTagName('button').item(0).click
_IEAction ($oIE, "visible")
;第二种
#include <IE.au3>
$oIE = _IECreate ("https://passport.csdn.net/account/login")
$oUser = _IEGetObjById($oIE, "u")
$oPass = _IEGetObjById($oIE, "p")
_IEFormElementSetValue ($oUser, "XXXXX")
_IEFormElementSetValue ($oPass, "XXXXX")
$oLogin = _IEGetObjById($oIE, "aLogin")
$oLogin.click()
;第三种
#include <IE.au3>
$oIE = _IECreate("https://passport.csdn.net/account/login", 0, 1, 1, 0)
_IELoadWait($oIE)
_IEPropertySet($oIE, "width", 800)
_IEPropertySet($oIE, "height", 600)
$oInputs = _IETagNameGetCollection($oIE, "INPUT")
For $oInput In $oInputs
If $oInput.id = "u" Then
$oInput.value = 'XXXXXXXXX'
EndIf
Next
For $oInput In $oInputs
If $oInput.id = "p" Then
$oInput.value = 'XXXXXX'
EndIf
Next
$oIE.document.getElementsByTagName('button').item(0).click
For $oInput In $oInputs
If $oInput.id = "aLogin" Then
_IEAction($oInput, "click")
EndIf
Next
试下屏幕点击? 哈哈哈沙发很可爱我也在学习 昨晚第一次拿一个论坛试手 就遇到了CSRF什么错误 好多大站都有限制了 不知道怎么破啊 有几个小站成功了。
注 SORRY看错了 以为是POST 本帖最后由 user3000 于 2013-8-21 18:56 编辑
回复 1# lsb968
它是个 HTTPS .....你那个其实不是真实网址!#include <IE.au3>
Local $url = 'https://passport.csdn.net/account/loginbox?callback=logined&hidethird=1&from=http%3a%2f%2fwww.csdn.net%2f'
$oIE = _IECreate ($url)
$oUser = _IEGetObjById($oIE, "u")
$oPass = _IEGetObjById($oIE, "p")
_IEFormElementSetValue ($oUser, "XXXXX")
_IEFormElementSetValue ($oPass, "XXXXX")
$oLogin = _IEGetObjById($oIE, "aLogin")
$oLogin.click()好像用这个网址就行了: https://passport.csdn.net/account/loginbox? 本帖最后由 lsb968 于 2013-8-21 19:14 编辑
回复 4# user3000
我用这个方法原来的网址也行了,用了风行者的工具
但不知道$oIE = $oFrame.contentWindow这句是什么意思,作用是什么
#include <IE.au3>
$oIE = _IECreate("https://passport.csdn.net/account/login", 0, 1, 1, 0)
$oFrame = _IEGetObjById($oIE,"logfrm")
$oIE = $oFrame.contentWindow
$Ele = _IEGetObjById($oIE,"u")
_IEFormElementSetValue($Ele,"xxx")
$Ele2 = _IEGetObjById($oIE,"p")
_IEFormElementSetValue($Ele2,"xxxx")
$Ele3 = _IETagNameGetCollection($oIE,"SPAN",0)
_IEAction($Ele3, "click")
学习了,楼主比我厉害好多啊 加油加油,我的钱呢。。。。 好東西, 推, 謝謝大大~
页:
[1]