How can I programmatically retrieve the title of a Microsoft Knowledge Base article by KB number?

I am trying to develop a program in C # that will get a list of available Windows updates and scan KB articles to get the headers of each update. (Otherwise, they all look like the cryptic "Update for Windows Server (KBxxxxx)")

I tried to get the HTML code of each KB article, but the title is missing in the HTML (I assume they use angular to build the page)

Here is an example: https://support.microsoft.com/en-us/kb/3102429 The title of the article, as shown in the browser, does not appear anywhere in the HTML when I view the source

Is there a good way to do this?

+5
source share
3 answers

For patches released after August 2017, the new API link looks like https://support.microsoft.com/app/content/api/content/help/en-us/4034733 .

For patches released after February 2017, the new API link looks like https://support.microsoft.com/api/content/help/3115489 .

Data on this page: JSON: enter image description here

If you download JSON data using Python, for example, you can find the header and other useful information in the "details" section. In particular,

d["details"]["id"] == u'3115489' d["details"]["title"] == u'February 7, 2017, update for Office 2013 (KB3115489)' d["details"]["publishedOn"] == u'2017-02-07T17:05:19.000368Z' 

For reference only, when loading the URL https://support.microsoft.com/kb/3115489 in Chrome with the developer tools running, network activity shows an XHR transfer from api / content / help:

enter image description here

+3
source

If in some way you can get the KB number from Windows Update, then the article should be available at the following URL:

https://support.microsoft.com/en-us/kb/YOUR_KB_NUMBER

And id="mt5" looks like a header.

EDIT:

My bad, the id does change, the first child of the <section> with class="section kb-article spacer-84-top" is the header, however this can change ... (take it as it is :)

enter image description here

0
source

As stated in the canon in the Aybe comments, the answer loads the source of the KB pages through the script after the page loads, so you cannot easily get this programmatically.

However, you can use the API link directly, for example, https://support.microsoft.com/api/content/kb/3102429

0
source

All Articles