I have this code written in PowerShell:
$username = \"xxxxxx\";
$password = \"xxxxxx\";
$url = \"www.facebook.com/login\";
$ie = New-Object -com internetexp
use this:
$Url = "http://websiteurl"
$ie = New-Object -com internetexplorer.application;
$ie.visible = $true; # make to $true to see the result in webpage
$ie.navigate($Url);
while ($ie.Busy -eq $true) { Start-Sleep -Seconds 10; }
($ie.Document.IHTMLDocument3_getElementsByName("btnname") | select -first 1).click();
$ie.quit()