probably it is a silly question, but I couldn't find the answer in Google so far. I need to read the HTML source code of a page http://Mysite/ViewRequest.aspx?request_id=xxx. I've setup following
wc = new-object -com internetexplorer.application
$wc.visible = $false
$wc.navigate2($strGRSpage).Document
$wc.silent = $true
$wc.visible = $false
$GRSstr = $wc.Document.body.IHTMLElement_outerText
Unfortunately the IE page pops up, even if I set $wc.silent = $true and $wc.visible = $false. Is there another way (even with HTTP request GET) to retrieve that data without getting the IE page. NOTE. The site http://Mysite/ViewRequest.aspx?request_id=xxx supports just IE and Mozilla. When I tried to use Webclient Class I get always unsupported browser.
In VBscript following works (but I want it in Powershell)
Set oHTML = CreateObject("Microsoft.XMLHTTP")
Set oWeb = CreateObject("InternetExplorer.Application")
oHTML.open "GET" , strGRSpage, false
oHTML.send
strGRStext = oHTML.responseText
Many thanks,
Marco