locked
HTML parsing with powershell RRS feed

  • Question

  • hello

    I'm trying to parse HTML using Powershell, I tried many methods but unfortunately without success,

    https://pcsupport.lenovo.com/Products/desktops-and-all-in-ones/thinkcentre-m-series-desktops/thinkcentre-m83/10ah/10ahs0k004/downloads

    the URL above provide an option to select component (like BIOS, WLAN driver etc), can anyone please explain how I can select the relevant component via PowerShell HTML parsing?

    $HTML =  Invoke-WebRequest -URI https://pcsupport.lenovo.com/Products/desktops-and-all-in-ones/thinkcentre-m-series-desktops/thinkcentre-m83/10ah/10ahs0k004/downloads

    I was unable to find a way to parse and take exactly the relevant info I need from the raw content, or at least to select only the component I need,

    I general I need to check the version of the BIOS which is available on the website, and the release date of the BIOS on the website,

    Any help will be greatly appreciated,

    Thanks,

    • Moved by Bill_Stewart Tuesday, November 7, 2017 9:53 PM This is not "teach me basics of how to parse html from a web site" forum
    Wednesday, September 20, 2017 7:55 AM

All replies

  • Parsing web sites is difficult and takes requisite programming skills.   There is no one-size-fits-all tool.

    Contact Lenovo for access to their API for programmatic access to the data. The site you posted cannot be parsed as it isa n Ajax site and Ajax is dynamic. Dynamic content will not be returned by Invoke-WebRequest.

    If you dump the HTML to a file you will see it is all formatting and script with no data.


    \_(ツ)_/

    Wednesday, September 20, 2017 8:30 AM