简体   繁体   English

如何在vb.net中自动单击Web浏览器中的超级链接?

[英]How do I click a hyper link in a web browser automatically in vb.net?

Let's say my browser goes to a page similar to this one below .. 假设我的浏览器转到了类似于以下内容的页面。

Picture Is Here 图片在这里

On this page there is a hyper link called 'Click Here' .. when I click it, it opens another window with things in it. 在此页面上,有一个名为“单击此处”的超级链接。当我单击它时,它将打开另一个包含内容的窗口。

How can I click this hyper link in vb.net automatically without me clicking on it with the mouse, and how do I open the window in a second web browser ? 如何在不使用鼠标单击的情况下自动在vb.net中单击此超级链接,以及如何在第二个Web浏览器中打开窗口?

We can assume that the first browser is called (WebBroswer1 ) and the second one is called (WebBrower2). 我们可以假设第一个浏览器称为(WebBroswer1),第二个浏览器称为(WebBrower2)。

I know how to perform buttons clicks and do raise the 'OnClick' Events, but I don't know how to do it with a hyper links. 我知道如何执行按钮点击并引发“ OnClick”事件,但是我不知道如何通过超链接来实现。

Please any help will be appreciated, I look forward for solutions. 请任何帮助将不胜感激,我期待着解决方案。

If you have jquery available in your webpage you can do something like 如果您的网页中有jquery,则可以执行以下操作

Say you have Click Here 说你有点击这里

you can programatically trigger the click of that link by doing: 您可以通过以下方式以编程方式触发该链接的点击:

$("#webbrowser2").trigger("click");

HTH 高温超导

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM