Autoit实现自动登录各大招聘网站#include <IE.au3> Opt("TrayAutoPause", 0) Opt("WinDetectHiddenText", 1) ;检测隐藏窗口 Opt("TrayMenuMode", 1) ;没有默认菜单 Opt("TrayOnEventMode", 1) ;响应托盘事件 Opt("WinTitleMatchMode", 2) ;匹配任意位置字符串 ;托盘菜单 $m_hr = TrayCreateItem("中华英才网") TrayItemSetOnEvent(-1, "chinahr") TrayCreateItem("") $m_zp = TrayCreateItem("智联招聘网") TrayItemSetOnEvent(-1, "zhaopin") TrayCreateItem("") ;TrayItemSetState($reset, $TRAY_DISABLE) $m_51 = TrayCreateItem("前程无忧网") TrayItemSetOnEvent(-1, "job51") TrayCreateItem("") $exit = TrayCreateItem("退出") TrayItemSetOnEvent(-1, "ExitEvent") While 1 Sleep(100) WEnd Func chinahr() $oIE = _IECreate("http://www.") WinSetState("中华英才网", "", @SW_MAXIMIZE) $o_form = _IEFormGetObjByName($oIE, "frmlogin") ;找到表单 $o_txtuser = _IEFormElementGetObjByName($o_form, "username") ;找到表单中的用户名 $o_txtpass = _IEFormElementGetObjByName($o_form, "password") ;找到表单中的 密码 _IEFormElementSetValue($o_txtuser, "duxt123") ; username _IEFormElementSetValue($o_txtpass, "") ; password $result = $oIE.document.parentWindow.eval_r("checkform()") ;提交表单 EndFunc ;==>chinahr Func zhaopin() $oIE = _IECreate("http://www./") WinSetState("智联招聘", "", @SW_MAXIMIZE) $o_form = _IEFormGetObjByName($oIE, "frmLogin") ;找到表单 $o_txtuser = _IEFormElementGetObjByName($o_form, "loginname") ;找到表单中的用户名 $o_txtpass = _IEFormElementGetObjByName($o_form, "password") ;找到表单中的 密码 _IEFormElementSetValue($o_txtuser, "duxt123") _IEFormElementSetValue($o_txtpass, "") _IEFormSubmit ($o_form, 0) ; 提交表单 EndFunc Func job51() $oIE = _IECreate("http://www./") WinSetState("前程无忧", "", @SW_MAXIMIZE) $o_form = _IEFormGetObjByName($oIE, "loginform") ;找到表单 $o_txtuser = _IEFormElementGetObjByName($o_form, "username") ;找到表单中的用户名 $o_txtpass = _IEFormElementGetObjByName($o_form, "userpwd") ;找到表单中的 密码 _IEFormElementSetValue($o_txtuser, "duxt123") _IEFormElementSetValue($o_txtpass, "") _IEFormSubmit ($o_form, 0) ;_IEFormImageClick ($oIE, "会员登录", "alt") ;两种方法提交表单数据 EndFunc Func ExitEvent() Exit EndFunc ;==>ExitEvent |
|