<A
onclick="javascript:url_link('../DutyPage/DutySend.aspx?si=FEE92689-9EC3-C4E0-9ADE-DE05C9071C06 &du=370aa11909844f679b386ac18542e1c6&apidos=795010')"
href="javascript:void(0);"><FONT
color=#ff0000>执行</FONT></A></LI></UL></DIV></DIV>这“执行”是超链接文字,我要用DELPHI的WEBBROWSER控件显示出当前页面后模拟自动点击这2字,请知道的朋友提供控制代码!谢谢!
onclick="javascript:url_link('../DutyPage/DutySend.aspx?si=FEE92689-9EC3-C4E0-9ADE-DE05C9071C06 &du=370aa11909844f679b386ac18542e1c6&apidos=795010')"
href="javascript:void(0);"><FONT
color=#ff0000>执行</FONT></A></LI></UL></DIV></DIV>这“执行”是超链接文字,我要用DELPHI的WEBBROWSER控件显示出当前页面后模拟自动点击这2字,请知道的朋友提供控制代码!谢谢!
with (WebBrowser1.Document as IHTMLDocument2).body.all as
IHTMLElementCollection do
for I := 0 to length - 1 do
with item(I, I) as IHTMLElement do
if SameText(tagName, 'a') then
with item(I, I) as IHTMLAnchorElement do
if SameText(href, 'http://www.csdn.net/') then click;
end;
WebBrowser1.Navigate('javascript:url_link(''参数'');javascript:vote(0)');
vDocument := WebBrowser1.Document as IHTMLDocument2;
vDocument.parentWindow.execScript('document.getElementsByName("ids")[0].checked=true','javascript');
astring:='flotaStep_first('+'''../GameTools/flotaStep_two.aspx?apidos=795010'''+')';
vDocument.parentWindow.execScript(astring,'javascript');我知道直接执行JS的办法,我分析过页面的源文件,但是由于“执行”所在页面是fromobjs.innerHTML内嵌框架,读不出源代码,只有模拟按“执行”2个字可以达到目的,请你想想办法怎么点击这2字
Docs := Docs.GetElementByID('AddCont').ContentWindow.Document; //<--'AddCont' Frame名称
ovElements := Docs.GetElementByID('imgbtn4');
ovElements.Click;
不好意思,请问你还有没有办法………………
思路大致如下: Docs := Web.OleObject.Document;
Docs := Docs.GetElementByID('AddCont').ContentWindow.Document; //<--到达iFrame//-->自己组织一下,在iFrame里面寻找自己要的超链接 begin
with (WebBrowser1.Document as IHTMLDocument2).body.all as
IHTMLElementCollection do
for I := 0 to length - 1 do
with item(I, I) as IHTMLElement do
if SameText(tagName, 'a') then
with item(I, I) as IHTMLAnchorElement do
if SameText(href, 'http://www.csdn.net/') then click;
end;
onclick="javascript:url_link('../DutyPage/DutySend.aspx?si=FEE92689-9EC3-C4E0-9ADE-DE05C9071C06 &du=370aa11909844f679b386ac18542e1c6&apidos=795010')"
href="javascript:void(0);"> <FONT
color=#ff0000>执行 </FONT> </A> </LI> </UL> </DIV> </DIV>
首先这个不是超链接,是点击事件,用SameText(href, 'http://www.csdn.net/') 是用来寻找href超链接的,晕~~~~~~~我都不知道哪理解错了,可以发我消息告诉我你的QQ吗?我们谈谈,谢谢,这个贴也是我的,100分,都给你!
http://topic.csdn.net/u/20080624/12/c1d0236f-01c3-4225-bece-6467bac93fdb.html