VMware Releases

Hi,

In order to stay up to date with the latest release and build versions on my Cluster, I’m trying to scrap some values off “VMware Knowledge Base

I tried Invoke-WebRequest but the content returned (RawContent) doesn’t show me the table I need.

So my question is, can anyone use ‘VMware Knowledge Base’ and return me:

$Name = ESXi 6.7 EP 06 , $Date = 01/17/2019, $BuildNo = 11675023

Thanks in advance

Tom

Hi Tom,

 

What have you tried ?

if I do the following

[pre]

$test=Invoke-WebRequest ‘VMware Knowledge Base
$test.ParsedHtml.

[/pre]

I have a lot of options to look into,

You have to put something behind the Last dot

Hi Bart,

I have tried a few different ways I’ve found on google, and I cannot find any way to pull the table I’m looking for

$test=Invoke-WebRequest 'https://kb.vmware.com/s/article/2143832?lang=en_US'
$test.ParsedHtml.getElementsByTagName('table')

 

Any advice or demo code that returns any table values should be enough to put me on the right track. Personally, I think its something to do with the way the website loads.

 

Thanks

Tom,

as long as VMWare does not provide a structured list in a file format Powershell can deal with natively you would need to parse the html by yourself to get what you need.

If you search in google for “powershell scrape website table” you’ll might get something helpful like this:

https://www.leeholmes.com/blog/2015/01/05/extracting-tables-from-powershells-invoke-webrequest/
https://stackoverflow.com/questions/25940510/how-to-extract-specific-tables-from-html-file-using-native-powershell-commands
https://sysjam.wordpress.com/2016/01/08/consuming-html-tables-with-powershell/

You have to do more than this to find what you are after.
Many sites, don’t allow mining like this either.
This site requires a logon before you can see anything, so you need to address that as well. If these HTML element come back bad or empty then your automation effort is not something the site vendor will support.

### How to scrape a web page with PowerShell

$w = Invoke-WebRequest -Uri 'https://kb.vmware.com/s/article/2143832?lang=en_US'

# TypeName
$w | Get-Member

# HTML Status
$w.StatusCode
$w.AllElements
$w.AllElements.Count
$w.Links.Count
$w.Links
$w.Forms
$w.Forms[0].Fields
$w.RawContent
$w.ParsedHtml

Hi All,

Thanks so much for all your replies, I found the returned HTML from a web request didn’t provide table information I needed.

However for anyone looking to do similar as I was, and searching for a solution… I have one!

Someone very nicely provides this information, updated hourly, and has been reliable for over 10 years (i have been told), they also provide this information in a very easy to parse JSON format! https://www.virten.net/repo/vTracker.json

Thanks all again for your efforts.

Tom