zhukongkui 发表于 2010-7-17 17:35:16

163邮箱登录不成功

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
$Form1 = GUICreate("邮箱登录器",700,480)

$Input1 = GUICtrlCreateInput("Input1", 184, 88, 161, 21)
$Input2 = GUICtrlCreateInput("Input2", 200, 108, 161, 21)
$Button1 = GUICtrlCreateButton("登陆", 208, 160, 105, 33)
GUISetState(@SW_SHOW)
While 1          
      $nMsg = GUIGetMsg()
      Switch $nMsg                       
                Case $GUI_EVENT_CLOSE
                        Exit
                           Case $Button1
                                   $oIE = _IECreateEmbedded ()
$GUIActiveX = GUICtrlCreateObj($oIE,16, 24, 668, 374)
$oIE.navigate("http://mail.163.com")
$oform = _IEGetObjById ($oIE, "login163")                               
$oQuery1 = _IEFormElementGetObjByName ($oform, "username");
_IEFormElementSetValue ($oQuery1,GUICtrlRead ($Input1));
$oQuery2 = _IEFormElementGetObjByName ($oform, "password")
_IEFormElementSetValue ($oQuery2,GUICtrlRead ($Input2));
_IEFormSubmit ($oform,0)
      EndSwitch
WEnd

lynfr8 发表于 2010-7-17 20:04:48

对于许多HTML表单
_IEFormSubmit() 可能不起作用因为经常是通过JS脚本获取点击事件来点击提交按钮.
在这种情况下你需要模拟一个点击动作代替使用 _IEFormSubmit().
参阅 _IEAction() 有关"click"动作的例子
或参考此文
http://www.autoitx.com/thread-16964-1-1.html

aayes 发表于 2010-7-18 10:23:35

参阅 _IEAction() 有关"click"动作的例子

qqmmcc 发表于 2010-7-18 15:09:22

感谢2楼解答,学习

yiruirui 发表于 2010-7-18 23:30:16

恩,这里需要用到_IEAction() ,能够解决!
页: [1]
查看完整版本: 163邮箱登录不成功