title: Method invocation failed because [System.ComObject] does not contain a method named 'IHTMLDocument3_getElementsByTagName'
body: <p>I've run into a problem that I can't figure out even after some frantic Googling. My PowerShell Script opens up a website, enters log in credentials and then selects a clickable link on the site. It is the clickable link I am having trouble with. </p>
  
  <p>The following line works on my PC (Windows 10) but fails on my server (Server 2012):</p>
  
  <pre><code>$Link=$ie.Document.IHTMLDocument3_getElementsByTagName("a") | where-object {$_.innerText -eq "Go to app"}
  </code></pre>
  
  <p>The error is:</p>
  
  <pre><code>Method invocation failed because [System.ComObject] does not contain a method named 
  'IHTMLDocument3_getElementsByTagName'.
  At C:\script.ps1:53 char:1
  $Link=$ie.Document.IHTMLDocument3_getElementsByTagName("a") | where-object {$_.i ...
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidOperation: (IHTMLDocument3_getElementsByTagName:String) [], RunTimeException
      + FullyQualifiedErrorID : MethodNotFound
  </code></pre>
  
  <p>This then makes my 'click' command fail:</p>
  
  <pre><code>$link.click()
  </code></pre>
  
  <p>Fails with: </p>
  
  <pre><code>You cannot call a method on a null-valued expression.
  At C:\script.ps1:54 char:1
  +link.click()
  +~~~~~~~~~~~~
      + CategoryInfo          : InvalidOperation: (:) [], RunTimeException
      + FullyQualifiedErrorID : InvokeMethodOnNull
  </code></pre>
  
  <p>I've ensured that .NET 4.5 is installed on the server. Any ideas or suggestions greatly appreciated! Even if it is to change the way I select the clickable link altogether :)</p>