0

I am trying to automate data collection from the vmware hardware compatibility list, focused around VSAN products. They have a searchable page, and once you put in your request, you get a list of results. They also have a button that allows "export to csv" of the results. The URL I am trying to work with is this one:

https://www.vmware.com/resources/compatibility/search.php?deviceCategory=hdd&vsan_type=vsanhdd&page=1&display_interval=500&details=1

I am trying to "click" that "Export to CSV" button using Powershell code.

I can locate the element that I am trying to click, and I see it has a method called ."click()" but it doesn't do anything when called.

$url = "https://www.vmware.com/resources/compatibility/search.php?deviceCategory=hdd&vsan_type=vsanhdd&page=1&display_interval=500&details=1"

$webrequest = Invoke-WebRequest -Uri $url

$a = $webrequest.ParsedHtml.getElementById("export_csv")
$a.Cick()

Using Chromes dev tools I noticed, once the export_csv button is clicked, a post request is being made to another URL, that actually generates the file. The post request contains the actual data that goes into the CSV, I believe it is already generated, somewhere on the page, but I can't seem to extract that form from the $webrequest variable.

Also I'm seeing there is also an export form appended to the body of the function, I'm pretty sure this is the source of the POST data (there seems to be a javascript function doing this). However I cannot seem to programatically reach that "form" element that I can see in Chrome Developer Tools when doing manual inspection of the page.

I would be happy if I can extract either the POST data, or simply invoke the export to CSV function and get the file it outputs.

Any ideas on how I can accomplish either of these? Thank you

IonutN
  • 91
  • 1
  • 10

1 Answers1

0

While I did not manage to find a way to do this action, this was just a means to an end, being able to extract the data Eventually I found out that vmware has some .js pages that it uses to actually compile that list. In those .js pages there is the entire vmware VCG dataset, like, IO devices, servers, vsan ready nodes, etc.

So if anyone else finds this useful, the links to the various data sets are below. Data here, seems to be organised into javascript variables, which can be consumed as is or parsed into Powershell objects like it was in my case.

https://www.vmware.com/resources/compatibility/js/data_cpu.js
https://www.vmware.com/resources/compatibility/js/data_server.js
https://www.vmware.com/resources/compatibility/js/data_io.js
IonutN
  • 91
  • 1
  • 10