I am trying to write a script in powershell that I can use to get HTML code from a website after executing a request.
On my own machine, I can run the following, which works without problems, but when I try to run it on a Server 2008 machine, I do not get the output from the Document.Body.InnerHTML command, all the details of Document.GetElementById work without problems.
$ie = New-Object -com InternetExplorer.Application $ie.silent = $true $ie.navigate2("http://www.mxtoolbox.com/") while($ie.busy) {start-sleep 1} $ie.Document.getElementById("ctl00_ContentPlaceHolder1_txtToolInput").Value = "mx:domain.co.uk" $ie.Document.getElementById("ctl00_ContentPlaceHolder1_btnAction").Click() Start-Sleep -Seconds 10 $ie.Document.body.innerHTML | Out-File "C:\NETESP\MXRecords\MXRecordsHTML.txt" -Encoding ASCII $ie.Quit()
Is there something I need to install on server 2008 to return this value?
Thanks at Advance
source share