Here you go, the way to do this is to actually do an Invoke-WebRequest . If we look at some properties of the object that we get from Invoke-WebRequest, we can see that PowerShell has already parsed some of the HTML and text for us.
All we need to do is highlight some of the values ββthat we would like to work with. For example, looking at the ParsedText field, we will see these results.

These fields begin approximately on line 30 or so. In my approach to solving this problem, we know that we will find good data like this in the middle of the page, so if we could clear the values ββfrom these lines, we would be on the way to working with the data. The code to execute this first part is as follows:
$url = "https://who.is/whois-ip/ip-address/$ipaddress" $Results = Invoke-WebRequest $url $ParsedResults = $Results.ParsedHtml.body.outerText.Split("`n")[30..50]
PowerShell now has some very powerful commands for importing and converting data into various formats. For example, if we could replace the colon character β:β with the equal sign β=β, we could send all the clutter to ConverFrom-StringData and have rich PowerShell objects to work with. It turns out that we can easily do this using the universal -Replace operator, like this
$Results.ParsedHtml.body.outerText.Split("`n")[30..50] -replace ":","="
I decided that you would want to do this again in the future, so I took all this and made five functions with five lines for you. Drop it into your profile and enjoy.
So, the finished result is as follows:
Function Get-WhoIsData { param($ipaddress='206.190.36.45') $url = "https://who.is/whois-ip/ip-address/$ipaddress" $Results = Invoke-WebRequest $url $ParsedResults = $Results.ParsedHtml.body.outerText.Split("`n")[30..50] -replace ":","=" | ConvertFrom-StringData $ParsedResults }
and its use works as follows:
PS C:\windows\system32> Get-WhoIsData -ipaddress 206.190.36.45 Name Value ---- ----- NetRange 206.190.32.0 - 206.190.63.255 CIDR 206.190.32.0/19 NetName NETBLK1-YAHOOBS NetHandle NET-206-190-32-0-1 Parent NET206 (NET-206-0-0-0-0) NetType Direct Allocation OriginAS Organization Yahoo! Broadcast Services, Inc. (YAHO) RegDate 1995-12-15 Updated 2012-03-02 Ref http=//whois.arin.net/rest/net/NET-206-190-32-0-1 OrgName Yahoo! Broadcast Services, Inc. OrgId YAHO Address 701 First Ave City Sunnyvale StateProv CA PostalCode 94089
You can then select any of the properties you want using the usual Select-Object or Where-Object commands. For example, to pull only the orgName property, you should use the following command:
(Get-WhoIsData).OrgName >Yahoo! Broadcast Services, Inc.