webbrowser向下滚动到Visual Basic中的html元素? [英] webbrowser scroll down to a html element in visual basic?
本文介绍了webbrowser向下滚动到Visual Basic中的html元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好论坛
我有一个问题,我想将我的Web浏览器向下滚动到一个名为提交"的html元素,任何人都可以帮助我?
Hi forum
I have a problem, I want to my webbrowser scroll down to a html element called "submit" anyone can help me?
推荐答案
您如何知道如何识别元素?页面上可以有多个文本提交",等等.有什么通用的方法可以找到它?据我了解,您想浏览一些不是您自己的页面.
我认为导航到所需位置的唯一可靠方法是通过URL.元素应该具有参数id
或用具有唯一属性name
的 anchor 元素a
进行标记.例如,假设您在URLhttp://www.myDomain.org/myPage.html
下使用按钮提供了一个网页,并可以选择用锚标记.
How do you know how to identify the element? There can be multiple text "Submit" on the page, etc. Is there any universal way to find it? As I understand, you want to navigate through some pages which are not yours.
I think the only reliable way to navigate to desired place is by URL. The element should either have an argumentid
or be marked with the anchor elementa
with the unique attributename
. For example, let''s assume you have a Web page served under the URLhttp://www.myDomain.org/myPage.html
with the button, optionally marked with a anchor.
<a name="scrollHere">
<button id="here" >Submit</button>
因此,要导航到基于锚点的按钮,请使用URL
So, to navigate to the button based on anchor, use the URL
http://www.myDomain.org/myPage.html#scrollHere
如果锚点不存在,但按钮具有属性name
,则也可以使用它:
If the anchor is not present but the button has the attribute name
you can use it as well:
http://www.myDomain.org/myPage.html#here
这篇关于webbrowser向下滚动到Visual Basic中的html元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文