About $ ie.Document.getElementById

I wrote a script to parse an HTML file. I have three machines: Windows 8.1, Windows Server 2012 and Windows Server 2008.

I am using a COM object and method $ie.Document.getElementById()

to get an element in an HTML file. The script works without any problems on Windows 8.1, but does not work on Windows Server 2012 and Windows Server 2008. It shows that it $ie.Document

is a null object.

I searched for a while and found that there is a bug with the COM object. So I manually imported the file Microsoft.mshtml.dll, now the script works well in win server 2012, but still does not work under win server 2008. I can see all the properties using $ie.document | Get-Member

, but the object is $ie.Document

always null.

+3


source to share


1 answer


Take a look at this question. IE has some kind of bug. Office installation fixed this issue for me. YMMV.



0


source







All Articles