none
Retrieve information from website RRS feed

  • General discussion

  • Hi, I hope this is the correct forum.  I have written a script that was working fine last week but now does not pull any data back from the following microsoft KB articles website.  Basically the script written in Powershell 5 running on a windows 7 machine used to do is when I download the KB spreadsheet from https://portal.msrc.microsoft.com/en-us/security-guidance this gives me a nice spreadsheet of all the kb articles for a given selection.  Unfortunatly without any summary detail so you would have to follow each and every hyperlink to view the kb summary.  So examining the the hyperlinks the only bit that changed was the kb number in the url so I could automate this very easy. I have inspected the class name on the example url in the code below and the summary section the class is still called kb-summary-section (as far as I can tell) but is is now not populating anything into $result

    Any ideas on what the issue is ??

    PS M:\> $PSVersionTable.PSVersion

    Major  Minor  Build  Revision
    -----  -----  -----  --------
    5      0      10586  117

    $web ="https://support.microsoft.com/en-us/help/4022887/title#!/en-us/help/4022887/title"
    $ie = new-object -ComObject "InternetExplorer.Application"
       $ie.silent = $true
       $ie.navigate($web)
       while($ie.busy){ sleep 1 }
       $result = $ie.document.body.getElementsByClassName("kb-summary-section") | select -ExpandProperty innertext
       $ie.quit()
       $result

    • Changed type Bill_Stewart Tuesday, November 21, 2017 7:04 PM
    • Moved by Bill_Stewart Tuesday, November 21, 2017 7:04 PM This is not "fix/debug/rewrite my script for me" forum
    Wednesday, July 19, 2017 10:55 AM

All replies

  • I am trying to get the summary information from https://support.microsoft.com/en-us/help/4022887/title#!/en-us/help/4022887/title

    The below coe was working on Friday but it now does not return anything.

    $web ="https://support.microsoft.com/en-us/help/4022887/title#!/en-us/help/4022887/title"
    $ie = new-object -ComObject "InternetExplorer.Application"
       $ie.silent = $true
       $ie.navigate($web)
       while($ie.busy){ sleep 1 }
       $result = $ie.document.body.getElementsByClassName("kb-summary-section") | select -ExpandProperty innertext
       $ie.quit()
       $result

    On inspecting the summary section I can see the classname has not changed so am at a bit of a loss.  What I am trying to do is when I download the update list from https://portal.msrc.microsoft.com/en-us/security-guidance is run a script that goes through each kb item and draws down the summary to save in the excel document rather than clicking on each and every kb item and using copy paste.  Like I said it was working fine on Friday but something has changed 

    • Merged by jrv Wednesday, July 19, 2017 5:16 PM DUPLICATE
    Wednesday, July 19, 2017 10:02 AM
  • If it used to work and no longer works, then they changed the web page and you will need to update your script accordingly. (Or ask the person who wrote the script for you to update it.)

    -- Bill Stewart [Bill_Stewart]

    Wednesday, July 19, 2017 12:23 PM
  • This is what I get when I run your code:

    An information disclosure vulnerability exists when the Windows kernel improperly initializes objects in memory. To exploit this vulnerability, an authenticated attacker 
    could run a specially crafted application. An attacker who successfully exploited this vulnerability could obtain information to further compromise the user’s system. The
     update addresses the vulnerability by correcting how the Windows kernel initializes objects in memory.
    To learn more about the vulnerability, go to  CVE-2017-8471.

    It retrieves 2 items

    The first one has the massive dose of text while the second one only contains "To learn more about the vulnerability, go to  CVE-2017-8471."

    Is that what you tried to retrieve?

    Cheers,

    Orel Fichman

    Wednesday, July 19, 2017 12:39 PM
  • Hi,

    Was your issue resolved? 

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.
    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.
    If no, please reply and tell us the current situation in order to provide further help.

    Best Regards,
    Frank

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Thursday, July 20, 2017 10:05 AM
  • Unfortunately it looks like a system change as it will not let me display the website in IE 9.  The page comes up but no details about the KB item.  (I think it may require a silverlight update that our Systems guys do not want to do).  If I go to the URL in chrome it displays fine

    So I have to come up with another way.  I have tried this but nothing is getting passed to $result

    $web ="https://support.microsoft.com/en-us/help/4022887/title#!/en-us/help/4022887/title"
    $data = invoke-Webrequest $web
    $result = $data.ParsedHtml.body.getElementsByClassName('kb-summary-section section ng-scope.x-hidden-focus')

    As I only want the information in the summary but nothing is being passed back to $result

    Thursday, July 20, 2017 10:37 AM
  • I had to change to simbrook2 as it would not let me reply on simbrook even though I was logged in :)
    Thursday, July 20, 2017 10:42 AM
  • Anyone any ideas how I can do this without using  -ComObject "InternetExplorer.Application"  and using  invoke-Webrequest or invoke-restmethod instead ??
    Thursday, July 20, 2017 2:07 PM
  • Does anyone know how to do this using Invoke-WebRequest, if not can you please suggest another forum I can try.

    Thanks

    Friday, July 21, 2017 7:29 AM
  • Hi,
    Just checking in to see if the information provided was helpful. Please let us know if you would like further assistance.

    Best Regards,

    Frank

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, August 11, 2017 4:47 AM
  • yes it is all working now.  Unfortunately I cant login as the user who created it hence I had to set up a new user simbrook2.  Can an admin please mark this as answered 
    Friday, August 11, 2017 12:59 PM