大家来看看我的问题,可能有点难!!

redsnow163 2005-08-05 01:13:50
我用WEBBROWSER控件打开一个网页,网页中有两个框架(frame1,frame2),怎么通过程序来点击frame1中的超连接呢? 哪位有HTML LIBRARY的教程或实例吗?有的请发到redsnow163@163.com,也可以在这里贴出来,谢谢
...全文
95 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
redsnow163 2005-08-09
  • 打赏
  • 举报
回复
没有高人指点一下小弟吗?
redsnow163 2005-08-07
  • 打赏
  • 举报
回复
我是想取得FRAME1中的超连接地址,然后再自动点击它啊,不是得到FRAME1的地址,而且超连接的地址也要在FRAME1中打开,而不能用WEBBROWSER控件的NAVIGATE来把网页都转到那个地址,
TaiJi1985 2005-08-06
  • 打赏
  • 举报
回复
使用webbrowser的document属性获得 文档对象,
这个文档对象是html分析出来的结果,根据他可以得到
frame的地址,然后用
Navigate转到相关的网页上,就实现了自动点击功能。

在msdn中关于document的资料

document

--------------------------------------------------------------------------------

Description

Represents the HTML document in a given browser window.


Remarks
You use the document object to retrieve information about the document, to examine and modify the HTML elements and text within the document, and to process events.

The document object is available at all times. You can retrieve the object by applying the document property to a window or an element object. If used by itself, document represents the document in the current window.

Examples

The following example checks for a document title and displays the title (if not null) in an alert (message) box.

if (document.title!="")
alert("The title is " + document.title)

The following example shows an event handler function that displays the current position of the mouse (relative to the upper-left corner of the document) in the browser's status window.

<HTML>
<HEAD><TITLE>Report mouse moves</TITLE>
<SCRIPT LANGUAGE="JScript">
function reportMove() {
window.status = "X=" + window.event.x + " Y=" + window.event.y;
}
</SCRIPT>
<BODY onmousemove="reportMove()">
<H1>Welcome!</H1>
</BODY>
</HTML>

Properties

activeElement, alinkColor, bgColor, body, charset, cookie, defaultCharset, domain, expando, fgColor, lastModified, linkColor, location, parentWindow, readyState, referrer, selection, title, URL, vlinkColor

Collections

all, anchors, applets, children, embeds, forms, frames, images, links, plugins, scripts, styleSheets

Methods

clear, close, createElement, createStyleSheet, elementFromPoint, execCommand, open, queryCommandEnabled, queryCommandIndeterm, queryCommandState, queryCommandSupported, queryCommandText, queryCommandValue, ShowHelp, write, writeln

Events

onafterupdate, onbeforeupdate, onclick, ondblclick, ondragstart, onerrorupdate, onhelp, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onreadystatechange, onrowenter, onrowexit, onselectstart


redsnow163 2005-08-06
  • 打赏
  • 举报
回复
老兄,不是这样的啊,FRAME1中的超连接地址预先是不知道的啊。
jxgzay 2005-08-05
  • 打赏
  • 举报
回复
假定frame1的超级连接为 htp="http://www.csdn.net"
Webrowser1.Navigate( htp )

7,762

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧