使用powershell单击超链接 [英] Click a hyperlink using powershell

查看:298
本文介绍了使用powershell单击超链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用powershell单击aspx webform中的超链接。我怎样才能做到这一点?
此链接显示一个下拉菜单,我必须从该链接中选择正确的选项。

I need to click on a hyperlink in a aspx webform using powershell. How can I achieve this? Also that link shows a drop down menu and I have to select the right option from that link.

推荐答案

$ie = new-object -com internetexplorer.application
$ie.visible=$true
$ie.navigate('http://www.somewhere.com')
while($ie.busy) {sleep 1}
$link = $ie.Document.getElementsByTagName('A') | where-object {$_.innerText -eq 'Click here'}
$link.click()

这篇关于使用powershell单击超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆