QQ邮箱(https://mail.qq.com/) 自动登录脚本

遇到了问题?请先进行搜索(中文和英文),然后在此提问
gongnl
Posts: 72
Joined: 05 Jan 2015, 03:57
Location: /gongnltmp/

QQ邮箱(https://mail.qq.com/) 自动登录脚本

Post by gongnl » 20 Jan 2015, 08:33

想写一个QQ邮箱(https://mail.qq.com/) 自动登录脚本,使用AHKinfo 工具获取用户框和密码框,因用户框和密码框是嵌在iframe中,获取不了 用户框和密码框的代码,请高手帮忙,如何用ahk代码给用户框和密码框赋值,并点击登录按钮,谢谢
garry
Posts: 1456
Joined: 22 Dec 2013, 12:50

Re: QQ邮箱(https://mail.qq.com/) 自动登录脚本

Post by garry » 01 Feb 2015, 03:36

not best way , I use this for GMX login

Code: Select all

#persistent
SetKeyDelay,25,5
Settitlematchmode,2

AA=garry12346@qq.com     ; << 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
gongnl
Posts: 72
Joined: 05 Jan 2015, 03:57
Location: /gongnltmp/

Re: QQ邮箱(https://mail.qq.com/) 自动登录脚本

Post by gongnl » 02 Feb 2015, 06:19

thank you! dont work for QQ mail
tmplinshi
Posts: 1263
Joined: 01 Oct 2013, 14:57

Re: QQ邮箱(https://mail.qq.com/) 自动登录脚本

Post by tmplinshi » 16 Feb 2015, 15:30

解决方案来自这个帖子: http://www.autohotkey.com/board/topic/9 ... /?p=578407

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 := "1311234567@qq.com"
frame.document.getElementById("p").value := "xxxxxxxxx"
frame.document.getElementById("login_button").Click()
garry
Posts: 1456
Joined: 22 Dec 2013, 12:50

Re: QQ邮箱(https://mail.qq.com/) 自动登录脚本

Post by garry » 20 Feb 2015, 05:34

thank you tmplinshi
gongnl
Posts: 72
Joined: 05 Jan 2015, 03:57
Location: /gongnltmp/

Re: QQ邮箱(https://mail.qq.com/) 自动登录脚本

Post by gongnl » 23 May 2015, 04:18

在 windows7中运行 tmplinshi 给出的脚本出错,请高手帮助
---------------------------
QQlogin.ahk
---------------------------
Error: No valid COM object!

Line#
001: ie := ComObjCreate("InternetExplorer.Application")
002: ie.Visible := True
003: ie.Navigate("https://mail.qq.com/")
004: While,(IE.readystate != 4 || IE.busy)
005: Sleep,100
---> 006: frame := ComObj(9,ComObjQuery(ie.document.getElementById("login_frame").contentWindow,"{332C4427-26CB-11D0-B483-00C04FD90119}","{332C4427-26CB-11D0-B483-00C04FD90119}"),1)
007: frame.document.getElementById("u").value := "12345678@qq.com"
008: frame.document.getElementById("p").value := "xxxxxx"
009: frame.document.getElementById("login_button").Click()
010: Exit
011: Exit
011: Exit

Continue running the script?
---------------------------
是(Y) 否(N)
---------------------------
tmplinshi
Posts: 1263
Joined: 01 Oct 2013, 14:57

Re: QQ邮箱(https://mail.qq.com/) 自动登录脚本

Post by tmplinshi » 23 May 2015, 04:36

不知是不是你的 AHK 版本太低了。在这个网站下载最新版试试。
gongnl
Posts: 72
Joined: 05 Jan 2015, 03:57
Location: /gongnltmp/

Re: QQ邮箱(https://mail.qq.com/) 自动登录脚本

Post by gongnl » 23 May 2015, 13:25

感谢tmplinshi 的回复,我AutoHotkey的版本升级为V1.1.22.00,重启计算机后,运行脚本不会出现上述的错误,但偶尔会出现运行完脚本,用户名和密码会自动输入但不会自动登陆的情况,还有想请教tmplinshi,我的计算机系统是win7,ie版本为IE11,我想实现如果QQ邮箱已经登陆,脚本就自动切换到QQ邮箱的iE标签,否则就新建一个IE标签(不是ie窗口)登陆QQ邮箱,恳请大侠帮忙,谢谢!!!
sansouci
Posts: 1
Joined: 25 Sep 2017, 20:10

Re: QQ邮箱(https://mail.qq.com/) 自动登录脚本

Post by sansouci » 12 Oct 2017, 08:21

tmplinshi wrote:解决方案来自这个帖子: http://www.autohotkey.com/board/topic/9 ... /?p=578407

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 := "1311234567@qq.com"
frame.document.getElementById("p").value := "xxxxxxxxx"
frame.document.getElementById("login_button").Click()
请教一下:登录按钮没id怎么处理?
Post Reply

Return to “请求帮助”