Jump to content

Internet Explorer Automation


Mr_Clean
 Share

Recommended Posts

I'm trying to automate the internet explorer page below to type in the Installation ID and License Number, as well as check the box and generate the unlock code. The issue I'm running into is that the page doesn't let me tab around it, and I can't find a way to select anything on the page.  

#include <IE.au3>
;Local $oIE = _IE_Example("form")
Local $oIE = ShellExecute('https://www.internetactivation.com/ECOSYSTEM/ActivationServer/tiactivate/default.aspx')
;Sleep(2000)
WinWaitActive('Activate - Internet Explorer')
$oSubmit = _IEGetObjByName($oIE, 'activatebutton')
;WinWaitActive('Activate - Internet Explorer')
_IEAction($oSubmit, "click")
_IELoadWait($oIE)

 

This is the code I've been playing around with to try and select the generate button and tab back to the text boxes, but I can't get it to work and it doesn't seem to be the best way to solve the problem. 

 

Any ideas? I'm very new to AudoIT still so please elaborate in technical details if you could!

Screenshot_1.png

Link to comment
Share on other sites

1 hour ago, Mr_Clean said:

Local $oIE = ShellExecute('https://www.internetactivation.com/ECOSYSTEM/ActivationServer/tiactivate/default.aspx')

Change this into this

Local $oIE = _IECreate('https://www.internetactivation.com/ECOSYSTEM/ActivationServer/tiactivate/default.aspx')

And you don't need this

1 hour ago, Mr_Clean said:

WinWaitActive('Activate - Internet Explorer')

Add a little bit of error checking to know if some function does return an error, and you're done :)

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

Link to comment
Share on other sites

3 hours ago, FrancescoDiMuro said:

Change this into this

Local $oIE = _IECreate('https://www.internetactivation.com/ECOSYSTEM/ActivationServer/tiactivate/default.aspx')

And you don't need this

Add a little bit of error checking to know if some function does return an error, and you're done :)

Thanks that works!

Link to comment
Share on other sites

3 hours ago, Danp2 said:

Use _IEFormGetObjByName, _IEFormElementGetObjByName, and _IEFormElementSetValue to set the value of the input elements.

You can use _IEFormElementCheckBoxSelect for the checkbox.

Ok so this is what I have right now...

 

#include <IE.au3>

Local $oIE = _IECreate('https://www.internetactivation.com/ECOSYSTEM/ActivationServer/tiactivate/default.aspx')
Local $oForm = _IEFormGetObjByName($oIE, 'sitecode')
Local $oQuery = _IEFormElementGetObjByName($oForm, ' form1')
_IEFormElementSetValue($oQuery, '0000000001')
_IEFormSubmit($oForm)

 

I don't yet have it working because I'm struggling to find the correct $sName for  _IEFormGetObjByName and _IEFormElementGetObjByName. Any pointers? 

Link to comment
Share on other sites

remember  when you post a  code  use a tag  <> 

i do somthing , but of course is not perfect but is  good base ;)

#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>
#include <File.au3>
#include <IE.au3>
#include <Array.au3>
#include <INet.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <WinAPIRes.au3>
#include <Misc.au3>
#include <Date.au3>
#include <Excel.au3>
#include <Crypt.au3>
#include <Misc.au3>

Global $oIE, $Hide = 1, $user = "jfkshkhsdkghkshg", $pass = "75947579573"

  $oIE = _IECreate("https://www.internetactivation.com/ECOSYSTEM/ActivationServer/tiactivate/default.aspx", 0, $Hide, 1, 1) ; <--- 0011 invisible explorer  <--- 0111 visible explorer
    _IELoadWait($oIE)

    Local $oBtns = $oIE.document.GetElementsByTagName("input")
    For $oBtn In $oBtns
        $name = String($oBtn.id())
        ;$placehold = String($oBtn.classname())
        If $name = "sitecode" Then
            _IEAction($oBtn, "click")
            _IEFormElementSetValue($oBtn, $user)
        EndIf
        If $name = "serial" Then
            _IEAction($oBtn, "click")
            _IEFormElementSetValue($oBtn, $pass)
        EndIf
        If $name = "activatebutton" Then
            _IEAction($oBtn, "click")
            ;_IEFormElementSetValue($oBtn, $user)
        EndIf
    Next

 

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...