Powershell not looping over all comobjects Powershell not looping over all comobjects powershell powershell

Powershell not looping over all comobjects


What you are getting as result is obvious behavior. If you observe the value for TagName property it is definitely going to be TD because you are getting the results from getElementsByTagName("td") method, so it is going to return all the elements where tag name is TD.

Now, if you are looking for values inside the tag (TD or table data) to return the values from the table cell then you should use $whatpage | %{$_.InnerText} or $ie.Document.getElementsByTagName("td") | foreach-object {write-output $_.InnerText}

Hope that helps!