gfunk999 Posted May 20, 2009 Share Posted May 20, 2009 Does anyone know how to get the object name for the Express button in Microsoft Update? http://update.microsoft.com/windowsupdate/...t.aspx?ln=en-usI know you can initiate updates with microsoft.update.session API, but i'm interested on why Microsoft hides their buttons.Thanks,Gary#include <IE.au3> $oIE = _IECreate ("http://update.microsoft.com/windowsupdate/v6/default.aspx?ln=en-us") $oSubmit = _IEGetObjByName ($oIE, "Express") ;Express does not exist on Microsoft update page source _IEAction ($oSubmit, "click") _IELoadWait ($oIE) Link to comment Share on other sites More sharing options...
weaponx Posted May 20, 2009 Share Posted May 20, 2009 (edited) It's not hidden, its in a different frame. Install the Microsoft Developer Toolbar for IE and you'll see it. Why they still use frames is beyond me. Edited May 20, 2009 by weaponx Link to comment Share on other sites More sharing options...
gfunk999 Posted May 20, 2009 Author Share Posted May 20, 2009 thank you for the reply I found it with the developer tool, it's named aExpress, but do i have to call a different frame? In my example aExpress does not work #include <IE.au3> $oIE = _IECreate ("http://update.microsoft.com/windowsupdate/v6/default.aspx?ln=en-us") $oSubmit = _IEGetObjByName ($oIE, "aExpress") _IEAction ($oSubmit, "click") _IELoadWait ($oIE) It's not hidden, its in a different frame. Install the Microsoft Developer Toolbar for IE and you'll see it. Why they still use frames is beyond me. Link to comment Share on other sites More sharing options...
weaponx Posted May 20, 2009 Share Posted May 20, 2009 You need to get the frame object and then use that to access the button.#683178 Link to comment Share on other sites More sharing options...
gfunk999 Posted May 20, 2009 Author Share Posted May 20, 2009 Actually I figured it out yesterday, thank you for your help! You need to get the frame object and then use that to access the button.#683178 Link to comment Share on other sites More sharing options...
AITR Posted May 22, 2009 Share Posted May 22, 2009 Does anyone know how to get the link names inside the eContent frame? (see attach picture for links names i'm trying to retrieve from Microsoft Updates) My example only returns these javascript links... 1 java script:parent.fnExpandDetails(35) 2 java script:parent.fnExpandDetails(35); 3 java script:parent.fnDisplayDetails("35"); 4 java script:parent.fnExpandDetails(23) 5 java script:parent.fnExpandDetails(23); 6 java script:parent.fnDisplayDetails("23"); 7 java script:parent.fnExpandDetails(16) #include <IE.au3> $oIE = _IEAttach ("Microsoft Update") ;attaching windows update after Express button is pressed $oIFRAME = _IEFrameGetObjByName ($oIE, "eContent") $oLinks = _IELinkGetCollection ($oIFRAME) $iNumLinks = @extended $num = 0 MsgBox(0, "Link Info", $iNumLinks & " links found") For $oLink In $oLinks $num = $num + 1 MsgBox(0, "Link Info", $num & " " & $oLink.href) Next Link to comment Share on other sites More sharing options...
gfunk999 Posted May 22, 2009 Author Share Posted May 22, 2009 (edited) I don't know how to get the links inside of frames, but I know you can use $oFrame = _IEFrameGetObjByName ($oIE, "FrameName") and _IETagNameAllGetCollection ($oFrame) to gather the names of these links. Does anyone know how to get the link names inside the eContent frame? (see attach picture for links names i'm trying to retrieve from Microsoft Updates) My example only returns these javascript links... 1 java script:parent.fnExpandDetails(35) 2 java script:parent.fnExpandDetails(35); 3 java script:parent.fnDisplayDetails("35"); 4 java script:parent.fnExpandDetails(23) 5 java script:parent.fnExpandDetails(23); 6 java script:parent.fnDisplayDetails("23"); 7 java script:parent.fnExpandDetails(16) #include <IE.au3> $oIE = _IEAttach ("Microsoft Update") ;attaching windows update after Express button is pressed $oIFRAME = _IEFrameGetObjByName ($oIE, "eContent") $oLinks = _IELinkGetCollection ($oIFRAME) $iNumLinks = @extended $num = 0 MsgBox(0, "Link Info", $iNumLinks & " links found") For $oLink In $oLinks $num = $num + 1 MsgBox(0, "Link Info", $num & " " & $oLink.href) Next Edited May 22, 2009 by gfunk999 Link to comment Share on other sites More sharing options...
weaponx Posted May 22, 2009 Share Posted May 22, 2009 (edited) The links are anchor elements with a child div containing the text value, they don't have the typical text attribute. #include <IE.au3> $oIE = _IEAttach ("Microsoft Update") ;attaching windows update after Express button is pressed $oIFRAME = _IEFrameGetObjByName ($oIE, "eContent") $oLinks = _IELinkGetCollection ($oIFRAME) $iNumLinks = @extended $num = 0 ;MsgBox(0, "Link Info", $iNumLinks & " links found") For $oLink In $oLinks $num = $num + 1 If StringInStr($oLink.id, "aTitle") Then ;ConsoleWrite($num & " " & $oLink.href & ", Id: " & $oLink.id & @CRLF) ;$div = $oLink.innerHTML $div = $oLink.firstChild ConsoleWrite($div.innerText & @CRLF) EndIf Next Edited May 22, 2009 by weaponx Link to comment Share on other sites More sharing options...
AITR Posted May 22, 2009 Share Posted May 22, 2009 Thank you Weaponx everything makes sense now. The links are anchor elements with a child div containing the text value, they don't have the typical text attribute. #include <IE.au3> $oIE = _IEAttach ("Microsoft Update") ;attaching windows update after Express button is pressed $oIFRAME = _IEFrameGetObjByName ($oIE, "eContent") $oLinks = _IELinkGetCollection ($oIFRAME) $iNumLinks = @extended $num = 0 ;MsgBox(0, "Link Info", $iNumLinks & " links found") For $oLink In $oLinks $num = $num + 1 If StringInStr($oLink.id, "aTitle") Then ;ConsoleWrite($num & " " & $oLink.href & ", Id: " & $oLink.id & @CRLF) ;$div = $oLink.innerHTML $div = $oLink.firstChild ConsoleWrite($div.innerText & @CRLF) EndIf Next Link to comment Share on other sites More sharing options...
AITR Posted May 23, 2009 Share Posted May 23, 2009 (edited) Just when I thought it made sense I ran into another snag how can I get the string value of onsubmit to a variable? please help. This is the line i'm trying to pull from the source code > name="quickCheck" onsubmit="java script: document.getElementById('btnDownload').disabled=true; setTimeout('document.getElementById(\'btnDownload\').disabled=false', 5000); if (g_IsIE) {window.open('http://download.microsoft.com/download/5/3/7/5374ce96-3838-4959-92af-77ab011fd704/WindowsXP-KB932823-v3-x86-ENU.exe This won't work #include <IE.au3> #include <array.au3> $oIE = _IEAttach("Download") ;http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=28e2fdb2-1aa5-4c84-8255-b3142ca2fe85 $oForm = _IEFormGetObjByName ($oIE, "quickCheck") $oText = _IEFormElementGetObjByName ($oForm, "onsubmit") MsgBox(0, "Form Element Value", _IEFormElementGetValue ($oText)) Edited May 23, 2009 by AITR Link to comment Share on other sites More sharing options...
weaponx Posted May 23, 2009 Share Posted May 23, 2009 This one is a pain in the ass, the onsubmit property always returns empty: #include <IE.au3> #include <array.au3> $oIE = _IEAttach("Download") ;http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=28e2fdb2-1aa5-4c84-8255-b3142ca2fe85 $oForm = _IEFormGetObjByName ($oIE, "quickCheck") ConsoleWrite(ObjName($oForm) & @CRLF) ConsoleWrite($oForm.onsubmit & @CRLF) ;EMPTY ConsoleWrite($oForm.getAttributeNode("onsubmit").value & @CRLF) ;CORRECT Link to comment Share on other sites More sharing options...
AITR Posted May 25, 2009 Share Posted May 25, 2009 Frist off thank you again for replying, so do you think it would be easier to read the HTML code, find this string and pass it to a variable? This one is a pain in the ass, the onsubmit property always returns empty: #include <IE.au3> #include <array.au3> $oIE = _IEAttach("Download") ;http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=28e2fdb2-1aa5-4c84-8255-b3142ca2fe85 $oForm = _IEFormGetObjByName ($oIE, "quickCheck") ConsoleWrite(ObjName($oForm) & @CRLF) ConsoleWrite($oForm.onsubmit & @CRLF) ;EMPTY ConsoleWrite($oForm.getAttributeNode("onsubmit").value & @CRLF) ;CORRECT Link to comment Share on other sites More sharing options...
storme Posted May 25, 2009 Share Posted May 25, 2009 Actually I figured it out yesterday, thank you for your help!Hay gfunk999What about posting your script as you build it. I'm also interested in this area and it'd be great to learn from your code.Thank youJohn Morrison Some of my small contributions to AutoIt Browse for Folder Dialog - Automation SysTreeView32 | FileHippo Download and/or retrieve program information | Get installedpath from uninstall key in registry | RoboCopy function John Morrison aka Storm-E Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now