Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Click a hyperlink using powershell

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.

like image 534
user423487 Avatar asked Dec 12 '25 18:12

user423487


1 Answers

$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()
like image 137
Shay Levy Avatar answered Dec 15 '25 09:12

Shay Levy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!