Jump to content

IE variable question


Recommended Posts

I am new at this IE topic so stick with me. Here is my code, with the questionmarks being what i am stuck on.

$oIE = _IECreate ("http://support.dell.com/support/downloads/index.aspx?c=us&l=en&s=gen&~f=")
$oForm = _IEFormGetObjByName ($oIE, "frmProductSelect")
$oQuery = _IEFormElementGetObjByName ($oForm, "ServiceTag")
_IEFormElementSetValue ($oQuery, $ServiceTag)
_IEFormSubmit ($oForm)
Sleep("1000")
$oIE2 = ??????????????????????????????????????????
$oForm2 = _IEFormGetObjByName ($oIE2, "formDownloadsCriteria")
$oQuery2 - _IEFormElementGetObjByName ($oForm2, "os")
If @OSVersion = WIN_XP then
     _IEFormElementSetValue ($oQuery2, "WW1")
ElseIf @OSVersion = WIN_2000 then
     _IEFormElementSetValue ($oQuery2, "WNT5")
EndIf
_IEFormSubmit ($oForm2)

It goes to the dell support download page and enters the computer's service tag into the field and goes to the next page. On the next page is a combo box with operating system selections; I figure I will do the exact same 5 steps as above, but I don't know what to set as the $oIE variable (as a reference for the _IEFormGetObjByName ). Is there something that sets the varaible to the current page, like @currentwindow or something? thanks! :whistle:

Edited by mike1305

Amp Energy Drink: the official sponsor of me scripting at 2AM.

Link to comment
Share on other sites

  • Moderators

I am new at this IE topic so stick with me. Here is my code, with the questionmarks being what i am stuck on.

It goes to the dell support download page and enters the computer's service tag into the field and goes to the next page. On the next page is a combo box with operating system selections; I figure I will do the exact same 5 steps as above, but I don't know what to set as the $oIE variable (as a reference for the _IEFormGetObjByName ). Is there something that sets the varaible to the current page, like @currentwindow or something? thanks! :whistle:

Try this:

#include <IE.au3>

$ServiceTag = "your-service-tag"
$sURL = "http://support.dell.com/support/downloads/index.aspx?c=us&l=en&s=gen&~f="
$oIE = _IECreate($sURL)
$oForm1 = _IEFormGetObjByName($oIE, "frmProductSelect")
$oQuery1 = _IEFormElementGetObjByName($oForm1, "ServiceTag")
_IEFormElementSetValue($oQuery1, $ServiceTag)
_IEFormSubmit($oForm1)

$oForm2 = _IEFormGetObjByName($oIE, "formDownloadsCriteria")
$oQuery2 = _IEFormElementGetObjByName($oForm2, "os")
If @OSVersion = "WIN_XP" Then
    _IEFormElementSetValue($oQuery2, "WW1")
ElseIf @OSVersion = "WIN_2000" Then
    _IEFormElementSetValue($oQuery2, "WNT5")
EndIf
_IEFormSubmit($oForm2)
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...