点击网页中指定的链接时,触发ahk脚本执行,能否给个实例?

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: 点击网页中指定的链接时,触发ahk脚本执行,能否给个实例?

Re: 点击网页中指定的链接时,触发ahk脚本执行,能否给个实例?

Post by gongnl » 10 May 2017, 01:58

当点击qq邮箱登录页面frame中的 元素时,却无法返回doc.parentWindow.event.srcElement.OuterHtml信息,请教高手将如何返回点击处的元素连接
代码如下:

Code: Select all

#Persistent
wb := ComObjCreate("InternetExplorer.Application")
wb.visible := True
wb.Navigate("https://mail.qq.com/cgi-bin/loginpage")
while wb.busy
	sleep 100
doc := wb.document
ComObjConnect(doc, "Doc_")
Return
  
Doc_OnClick(doc) {
    MsgBox, % doc.parentWindow.event.srcElement.OuterHtml
}

Re: 点击网页中指定的链接时,触发ahk脚本执行,能否给个实例?

Post by gongnl » 20 Mar 2017, 07:57

我找了个类似例子:

Code: Select all

Gui Add, ActiveX, w500 h300 vwb, Shell.Explorer
wb.Navigate("http://ahkscript.org")
while wb.busy
	sleep 100
doc := wb.document
ComObjConnect(doc, "Doc_")
Gui, Show
Return

GuiClose:
ExitApp

Doc_OnClick(doc) {
    MsgBox, % doc.parentWindow.event.srcElement.OuterHtml
}
修改如下:

Code: Select all

#Persistent
wb := ComObjCreate("InternetExplorer.Application")
wb.Navigate("http://www.baidu.com")
while wb.busy
	sleep 100
doc := wb.document
ComObjConnect(doc, "Doc_")
Return

Doc_OnClick(doc) {
    MsgBox, % doc.parentWindow.event.srcElement.OuterHtml
}
ok

点击网页中指定的链接时,触发ahk脚本执行,能否给个实例?

Post by gongnl » 20 Mar 2017, 04:12

请教大神,点击ie网页中指定的链接时,触发ahk脚本提取打开的网页中的字段,能否给个实例,谢谢

Top