So I'm trying to get some text from a website, and as soon as I try to return an object with ParsedHtml, powershell stops responding (even when I let it run in the background a few minutes it wont do anything anymore). What can be the cause of that?
PS P:\> $url = "mywebsite"
PS P:\> $result = invoke-WebRequest $url
PS P:\> $result | Get-Member
TypeName: Microsoft.PowerShell.Commands.HtmlWebResponseObject
Name MemberType Definition
---- ---------- ----------
Dispose Method void Dispose(), void IDisposable.Dispose()
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
AllElements Property
Microsoft.PowerShell.Commands.WebCmdletElementCollection AllElements {get;}
BaseResponse Property System.Net.WebResponse BaseResponse {get;set;}
Content Property string Content {get;}
Forms Property
Microsoft.PowerShell.Commands.FormObjectCollection Forms {get;}
Headers Property
System.Collections.Generic.Dictionary[string,string] Headers {get;}
Images Property
Microsoft.PowerShell.Commands.WebCmdletElementCollection Images {get;}
InputFields Property
Microsoft.PowerShell.Commands.WebCmdletElementCollection InputFields {get;}
Links Property
Microsoft.PowerShell.Commands.WebCmdletElementCollection Links {get;}
ParsedHtml Property mshtml.IHTMLDocument2 ParsedHtml {get;}
RawContent Property string RawContent {get;set;}
RawContentLength Property long RawContentLength {get;}
RawContentStream Property System.IO.MemoryStream RawContentStream {get;}
Scripts Property
Microsoft.PowerShell.Commands.WebCmdletElementCollection Scripts {get;}
StatusCode Property int StatusCode {get;}
StatusDescription Property string StatusDescription {get;}
PS P:\> $result.ParsedHtml | Get-Member
And then the programm freezes after last command. A popup pops up asking me if its allowed to save cookies on my pc, but neither clicking yes nor no will help anything.. What can be the cause of this?
$result.RawContent
for example works just fine and prints out all of the html text, but has no getelementsby-Method, which I guess is in ParsedHtml, hence why I would need it..it works for example on youtube but on a specific site i want to check it freezes. Any help is greatly appreciated!