HOWTO: Grab the all file download links on a HP Inc driver download page and wget them

So you have a brand new HP Inc machine to deploy, or you are finally getting around to upgrading to Windows 10…  You’ll need to download the drivers for that machine from HP Inc’s support site.  But you don’t want to use their 2 year old driver pack, kill your internet connection by launching 38 separate downloads at once from your browser, or babysit one or two downloads in the browser at a time (an all day task). Well here is a simple way to grab all the file download links at once and then use wget to sequentially get those files one after another – hands free in a command prompt.  All you need is Notepad++ and a copy of wget.exe somewhere in your machine’s system path.

I’ve had good luck with getting wget from here:  https://eternallybored.org/misc/wget/
And you can install Notepad++ using Ninite’s installer from here:  https://ninite.com/

Extract wget.exe and put it somewhere in your system path (i.e. C:\Windows).

Open your browser of choice, go to the HP Inc driver support download page for the product and OS version you need and then view the page’s source code in your browser (typically accomplished by right clicking the page and selecting “view page source”.

Copy the entire page’s source code (“CTRL + A” then “CTRL + C“) and paste it (“CTRL + V“) into an empty Notepad++ window, then hit “CTRL + H” to open Notepad++’s search/replace dialog box.

Click the “Extended Search Mode” radio button.

Search for: #
Replace with: {blank}
Hit the Replace All button
Tip – press CTRL + A then hit backspace or delete in the Replace with box to blank it’s contents

Search for: \t
Replace with: {blank}
Hit the Replace All button

Search for: ‘”>\r\n
Replace with: \r\n
Hit the Replace All button
Tip – this is an apostrophe, quote, greater than sign, backslash, r, backslash, n

Search for: “>\r\n
Replace with: \r\n
Hit the Replace All button
Tip – this is quote, greater than sign, backslash, r, backslash, n

Search for: obtainSoftware?url=
Replace with: \r\n###
Hit the Replace All button
Hit the Close button (on the replace dialog box)

Press “CTRL + A” to select all text

From the Edit drop down menu, select Blank Operations –> Trim Leading and Trailing Space
From the Edit drop down menu, select Blank Operations –> Remove Empty Lines (Containing blank characters)
From the Edit drop down menu, select Line Operations –> Sort Lines Lexicographically Ascending

Hit “CTRL + Home” to go to the top of the document

You should now see several lines that start with ###6874 – highlight just these lines and copy them with “CTRL + C“, then press “CTRL + N” to create a new document, then press “CTRL + V” to paste the copied lines into the new document.

Hit “CTRL + H” to open the replace dialog box again.

Search for: ###
Replace with: {blank}
Hit the Replace All button
Hit the Close button (on the replace dialog box)

Press “CTRL + A” to select all text

From the Notepad++ Plugins drop down menu at the top of the screen, select Converter –> “HEX -> ASCII”

Hit “CTRL + H” to open the replace dialog box

Search for: http:
Replace with: \r\nwget -c -N -T 20 -t 20 http:
Hit the Replace All button
Hit the Close button (on the replace dialog box)

Hit “CTRL + Home

You should now be left with a bunch of wget lines.

Press “CTRL + A” to select all text
Press “CTRL + C” to call all the text

You should now be able to open a command prompt, change the folder of your choice and right click to paste the whole group of wget commands at once into the command prompt, which will start sequentially downloading the files from HPE or HP Inc, one at a time until all the files have been downloaded.

2016-10-14-07-21-56-snagit-0031

Now you are free to go work on something else (or have a coffee, lunch, beer, nap, etc.) while your files are downloaded.

Once all the files are downloaded, in Explorer enable the Product Name and Product Version columns (in detailed view) to determine what each SP file is.  As an added bonus, the original time stamps of the download files are maintained too.

2016-10-14-07-45-48-snagit-0032

As always – Use any tips, tricks, or scripts I post at your own risk.

One thought on “HOWTO: Grab the all file download links on a HP Inc driver download page and wget them

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s