How about using the API to get all the data you want? This way you get the entire response and you can either dump it to a JSON file, filter for items that you want and save it as .csv or whatever else you need and/or want to do.

Try this:

import csv
import time
from urllib.parse import urlencode

import requests
from tabulate import tabulate

product_code = "precision-15-5520-laptop"
dell_api = "https://www.dell.com/support/driver/en-uk/ips/api/driverlist/getdriversbyproduct?"

headers = {
    "referer": f"https://www.dell.com/support/home/en-uk/product-support/product/{product_code}/drivers",
    "user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36",
    "x-requested-with": "XMLHttpRequest",
}
payload = {
    "productcode": product_code,
    "oscode": "WT64A",
    "lob": "Dell Precision Mobile WorkStation",
    "initialload": True,
    "_": time.time() * 1000,
}

updates_data = requests.get(f"{dell_api}{urlencode(payload)}", headers=headers).json()

row_headers = [
    "Release Date", "Last Update", "Version",
    "Update status", "File Name", "Description",
]

rows = [
    [
        driver['ReleaseDate'],
        driver['LUPDDate'],
        driver['DellVer'],
        driver['Imp'],
        driver['FileFrmtInfo']['FileName'],
        # driver['BrfDesc']  uncomment this to get the description
    ] for driver in updates_data["DriverListData"]
]

with open("dell_updates_data.csv", "w") as output:
    w = csv.writer(output)
    w.writerow(row_headers)
    w.writerows(rows)

print(tabulate(rows, headers=row_headers))

Output:

Release Date    Last Update    Version                Update status    File Name
--------------  -------------  ---------------------  ---------------  ------------------------------------------------------------------------------------------------------
28 Sep 2020     13 Oct 2020    5.2.1.12926, A00       Recommended      SupportAssist-Update-Plugin-Application_6HWP6_WIN_5.2.1.12926_A00.EXE
14 Sep 2020     14 Sep 2020    5.1.89.0, A00          Recommended      Dell-PremierColor-Software-Application_2GH2M_WIN64_5.1.89.0_A00.EXE
03 Sep 2020     23 Sep 2020    1.1.112.0, A00         Recommended      Dell-Optimizer_06RN7_WIN_1.1.112.0_A00.EXE
19 Aug 2020     19 Aug 2020    8.1.958.0, A01         Recommended      nVIDIA-Control-Panel_D66P1_WIN64_8.1.958.0_A01.EXE
30 Jul 2020     28 Sep 2020    1.0.26.0, A08          Recommended      Intel-Thunderbolt-Controller-Application_TAPOF_WIN64_1.0.26.0_A08_02.EXE
12 May 2020     12 Oct 2020    4.0.52.0, A17          Optional         Dell-Alienware-Digital-Delivery-Application_PDKG8_WIN_4.0.52.0_A17.EXE
02 Nov 2020     02 Nov 2020    6.0.9025.1, A03        Recommended      Realtek-High-Definition-Audio-Driver_JJWPF_WIN_6.0.9025.1_A03.EXE
07 Sep 2020     07 Sep 2020    6.0.9008.1, A03        Recommended      Realtek-Audio-Driver_3D5WW_WIN_6.0.9008.1_A03.EXE
07 May 2020     14 Oct 2020    3.0.30.0, A02          Recommended      Waves-MaxxAudio-Pro-Application_M96FF_WIN64_3.0.30.0_A02_01.EXE
15 Sep 2020     15 Sep 2020    1.4.0, 1.4.0           Urgent           Precision_5550_1.4.0.exe

and so on ...

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top