QQ邮箱(https://mail.qq.com/) 自动登录脚本
Posted: 20 Jan 2015, 08:33
想写一个QQ邮箱(https://mail.qq.com/) 自动登录脚本,使用AHKinfo 工具获取用户框和密码框,因用户框和密码框是嵌在iframe中,获取不了 用户框和密码框的代码,请高手帮忙,如何用ahk代码给用户框和密码框赋值,并点击登录按钮,谢谢
Let's help each other out
https://www.autohotkey.com/boards/
Code: Select all
#persistent
SetKeyDelay,25,5
Settitlematchmode,2
[email protected] ; << login
BB=0123456789 ; << code
;FXA=http://www.gmx.ch/
fxa=https://mail.qq.com/ ; << URL
;SC=GMX
SC =QQ ; << see text in browser TAB
IXE=%A_programfiles%\Mozilla Firefox\firefox.exe
;IXE=%A_programfiles%\internet explorer\iexplore.exe
Run,%IXE% %FXA%,,max
WinWait,%SC%
IfWinNotActive ,%SC%,,WinActivate,%SC%
WinWaitActive,%SC%
;- wait until browser is really loaded and then click left mouse button in first login edit field QQ / Email / Mobile
;- wait until left mouse click <<<<<
KeyWait, LButton, D
sleep,4000
send,%AA%
;msgbox, 262144, a,AA=%aa%, 2
sleep,1000
send,{TAB}
sleep,2000
send,%BB%
;msgbox, 262144, a,BB=%bb%, 2
sleep,1000
send,{TAB}
sleep,1000
send,{ENTER}
ExitApp
Code: Select all
ie := ComObjCreate("InternetExplorer.Application")
ie.Visible := True
ie.Navigate("https://mail.qq.com/")
While, (IE.readystate != 4 || IE.busy)
Sleep, 100
frame := ComObj(9,ComObjQuery(ie.document.getElementById("login_frame").contentWindow,"{332C4427-26CB-11D0-B483-00C04FD90119}","{332C4427-26CB-11D0-B483-00C04FD90119}"),1)
frame.document.getElementById("u").value := "[email protected]"
frame.document.getElementById("p").value := "xxxxxxxxx"
frame.document.getElementById("login_button").Click()
请教一下:登录按钮没id怎么处理?tmplinshi wrote:解决方案来自这个帖子: http://www.autohotkey.com/board/topic/9 ... /?p=578407Code: Select all
ie := ComObjCreate("InternetExplorer.Application") ie.Visible := True ie.Navigate("https://mail.qq.com/") While, (IE.readystate != 4 || IE.busy) Sleep, 100 frame := ComObj(9,ComObjQuery(ie.document.getElementById("login_frame").contentWindow,"{332C4427-26CB-11D0-B483-00C04FD90119}","{332C4427-26CB-11D0-B483-00C04FD90119}"),1) frame.document.getElementById("u").value := "[email protected]" frame.document.getElementById("p").value := "xxxxxxxxx" frame.document.getElementById("login_button").Click()