powershell script to go to web site

%3CLINGO-SUB%20id%3D%22lingo-sub-2376968%22%20slang%3D%22en-US%22%3Epowershell%20script%20to%20go%20to%20web%20site%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2376968%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20have%20to%20check%20Yes%20or%20No%20on%20the%20website%20but%20I%20thought%20it%20would%20be%20a%20great%20opportunity%20to%20automate%20it%20with%20powershell%20but%20I%20am%20having%20problem%20trying%20to%20understand%20how%20to%20get%20it%20to%20automatically%20click%20on%20the%20element.%20Here%20is%20what%20I%20have%20so%20far.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%23%3CBUTTON%20class%3D%22%26quot%3Bbtn%22%20no%3D%22%22%3ENo%3C%2FBUTTON%3E%3CBR%20%2F%3E%24ie%20%3D%20New-Object%20-ComObject%20'internetExplorer.Application'%3CBR%20%2F%3E%24ie.Visible%3D%20%24true%3CBR%20%2F%3E%24ie.ParsedHtml%3CBR%20%2F%3E%24ie.Navigate(%22%3CA%20href%3D%22https%3A%2F%2Fnam11.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Flnks.gd%252Fl%252FeyJhbGciOiJIUzI1NiJ9.eyJidWxsZXRpbl9saW5rX2lkIjoxMDEsInVyaSI6ImJwMjpjbGljayIsImJ1bGxldGluX2lkIjoiMjAyMTA1MTEuNDAyNjU1NjEiLCJ1cmwiOiJodHRwczovL3d3dy5mYWEuZ292L2Nvcm9uYXZpcnVzL3dlbGxuZXNzX2NoZWNrLyJ9.e4fctVtbkCtZ1yDQ2f2ZIyUCLgx3KceG4A0AIuiZTPk%252Fs%252F770634691%252Fbr%252F106182191351-l%26amp%3Bdata%3D04%257C01%257Csasha.tabib%2540lstechllc.com%257Cb2bcd86b5a174ff6488108d914916338%257C93bb738069e94c7ca5fbfd30a5f59cc9%257C0%257C0%257C637563436952056800%257CUnknown%257CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%253D%257C1000%26amp%3Bsdata%3D0KULfdRzubnmWAdCqW94wE4%252F7fFTyuXSwNsCBSTGfkY%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fnam11.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Flnks.gd%252Fl%252FeyJhbGciOiJIUzI1NiJ9.eyJidWxsZXRpbl9saW5rX2lkIjoxMDEsInVyaSI6ImJwMjpjbGljayIsImJ1bGxldGluX2lkIjoiMjAyMTA1MTEuNDAyNjU1NjEiLCJ1cmwiOiJodHRwczovL3d3dy5mYWEuZ292L2Nvcm9uYXZpcnVzL3dlbGxuZXNzX2NoZWNrLyJ9.e4fctVtbkCtZ1yDQ2f2ZIyUCLgx3KceG4A0AIuiZTPk%252Fs%252F770634691%252Fbr%252F106182191351-l%26amp%3Bdata%3D04%257C01%257Csasha.tabib%2540lstechllc.com%257Cb2bcd86b5a174ff6488108d914916338%257C93bb738069e94c7ca5fbfd30a5f59cc9%257C0%257C0%257C637563436952056800%257CUnknown%257CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%253D%257C1000%26amp%3Bsdata%3D0KULfdRzubnmWAdCqW94wE4%252F7fFTyuXSwNsCBSTGfkY%253D%26amp%3Breserved%3D0%3C%2FA%3E%22)%3CBR%20%2F%3E%24document%20%3D%20%24ie.Document%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2376968%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

We have to check Yes or No on the website but I thought it would be a great opportunity to automate it with powershell but I am having problem trying to understand how to get it to automatically click on the element. Here is what I have so far. 

 

#<button class="btn no" id="noInit" type="button">No</button>
$ie = New-Object -ComObject 'internetExplorer.Application'
$ie.Visible= $true
$ie.ParsedHtml
$ie.Navigate("https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flnks.gd%2Fl%2FeyJhbGciOiJIUzI1NiJ9...")
$document = $ie.Document

0 Replies