Jump to content

Find Text on the Microsoft Update Website...


Recommended Posts

Im gettings started on my script to automate Windows update using IE.au3. From what I can tell, it seems that the links in the microsoft site is pretty damn hard to navigate, and from a look at the source code, they seem to have put EVERYTHING in it rather than the info of the current page. What I need to do isnt hard...

Open windowsupdate.microsoft.com

wait until the page is done loading to the part where u can press the "Express" button

Click the button

wait until its done checking to see what updates you need

Click download/install updates

Let the updater run by itself

Seems simple, but most of the functions in IE.au3 does not seem to work. Certain text shown on the page is not shown in $text = _IEDocReadHTML($page), on the other hand, buttons and messages that appears in previous/later pages IS found in it...

I am really confused, hope one of you guys can help

Link to comment
Share on other sites

i guess no help on this topic... damn

ok does anyone know how to do this then?

You do ctrl+a and it will select all the text show on a page... right?

so how do u save that text into a variable?

I might have to resort to this crude way of determining if a page is done loading if nothing else works

Edited by probedrone
Link to comment
Share on other sites

This should get you started.

#include <IE.au3>

_IEErrorHandlerRegister()

$sURL = "http://update.microsoft.com"
$oIE = _IECreate($sURL, 1)
$oFrame = _IEFrameGetObjByName($oIE, "eContent")
_IELoadWait($oFrame)
$oLink = _IELinkGetCollection($oFrame, 0)
_IEAction($oLink, "click")
smashing! the problem is I dont know 90% of what you did...haha

where did you get that "eContent" from?

Link to comment
Share on other sites

  • Moderators

If you run this script it should give you an idea.

#include <IE.au3>

_IEErrorHandlerRegister()

$sURL = "http://update.microsoft.com"
$oIE = _IECreate($sURL, 1)
$oFrames = _IETagNameGetCollection($oIE, "FRAME")
$i = 0
For $oFrame In $oFrames
    $sText = ""
    $sText &= "===============" & @CRLF
    $sText &= "Index = " & $i & @CRLF
    $sText &= "Name = " & $oFrame.Name & @CRLF
    $sText &= "SRC = " & $oFrame.Src & @CRLF
    ConsoleWrite($sText)
    $i += 1
Next
ConsoleWrite("===============" & @CRLF)
Link to comment
Share on other sites

#include <IE.au3>

_IEErrorHandlerRegister()

$sURL = "http://update.microsoft.com"
$oIE = _IECreate($sURL, 1)
$oFrames = _IETagNameGetCollection($oIE, "FRAME")
$i = 0
For $oFrame In $oFrames
    $sText = ""
    $sText &= "===============" & @CRLF
    $sText &= "Index = " & $i & @CRLF
    $sText &= "Name = " & $oFrame.Name & @CRLF
    $sText &= "SRC = " & $oFrame.Src & @CRLF
    $oLinks = _IELinkGetCollection($oFrame, 0)
    For $oLink in $oLinks
        $sText &= "Link = " & $oLink & @CRLF
    Next
    ConsoleWrite($sText)
    $i += 1
Next
ConsoleWrite("===============" & @CRLF)

tried to add a bit more to ur idea to see how it all works out, and conclusion was that it doesnt...

What am I doing wrong here?

Sry but I have no idea whatsoever dealing with IE.au3

Link to comment
Share on other sites

The 0 in

_IELinkGetCollection($oFrame, 0)

selects just the first link. Remove it or set it to -1 to get the collection.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

well i tried with and without the 0... neither gives me anything. or is it that the links cannot be shown in the $sText string?

Oh yes, sorry I missed that. They are objects, not plain text. Thy $oLink.outerText or $oLink.href

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

#include <IE.au3>

_IEErrorHandlerRegister()

$sURL = "http://update.microsoft.com"
$oIE = _IECreate($sURL, 1)
$oFrames = _IETagNameGetCollection($oIE, "FRAME")
$i = 0
For $oFrame In $oFrames
    $sText = ""
    $sText &= "===============" & @CRLF
    $sText &= "Index = " & $i & @CRLF
    $sText &= "Name = " & $oFrame.Name & @CRLF
    $sText &= "SRC = " & $oFrame.Src & @CRLF
    $oLinks = _IELinkGetCollection($oFrame)
    For $oLink in $oLinks
        $sText &= "Link = " & $oLink.outerText & @CRLF
    Next
    ConsoleWrite($sText)
    $i += 1
Next
ConsoleWrite("===============" & @CRLF)

Not working either :P

In fact, the "Link = blah blah" line isnt even showing up on console...so I have no idea how big_dady got the EXPRESS button to click.

BTW is there a help file for IE.au3 explains the functions like .outerText and .Src? (Whats Src anyway?)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...