Sign in to follow this  
Followers 0
Regency

Reloading ie embedded

6 posts in this topic

Ok, so this script works by itself, and does exactly what i want. but id there a way to make it open again, like, after i click start, it uses the info in the input and adds it to the field in the ie window, and reloads the img in the ie embedded for the next page i want. Like..

#include <GUIConstantsEx.au3>
#include <IE.au3>
#include <WindowsConstants.au3>
Y
Global $Url = "tmnx.net"
Global $A1 = ""
Global $P1 = ""
Global $tmnx = ""
Global $name1 = ""



$Tmnx = _iecreate($Url,0,1,1,0)
_IELoadWait($Tmnx)
_IEErrorHandlerRegister ()

$oIE = _IECreateEmbedded ()
GUICreate("Embedded Web control Test", 450, 300, _
        (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
        $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$Desired = GUICtrlCreateGroup("Enter Captcha Answer",8,225,425,49)
$username = GUICtrlCreateInput("", 16, 241, 114, 21)
$savename = GUICtrlCreateButton("Save", 168, 241, 75, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 10, 400, 200)
$User = GUICtrlCreateLabel("", 8, 352, 250, 17) ; This is 
$Make = GUICtrlCreateButton("Start", 300, 241, 75, 25, 0)
GUISetState()       ;Show GUI


$oImg = _IEImgGetCollection($Tmnx,0)
$sInfo = $oImg.src
_IENavigate ($oIE,$oimg.src)

While 1
   $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $savename
            $name1 = GUICtrlRead($username)
            GUICtrlSetData($User, $name1)
        Case $msg
           Relog()
           GUIDelete()
           Exit
   EndSelect
WEnd

Func Relog()

    $oUser = _IEGetObjByName($Tmnx, "txtUsername")
    _IEFormElementSetValue($oUser, $A1)
    $oPass = _IEGetObjByName($Tmnx, "txtPassword")
    _IEFormElementSetValue($oPass, $P1)
    $oCap = _IEGetObjByName($Tmnx, "recaptcha_response_field")
    _IEFormElementSetValue($oCap, $name1)
    $oLogIn = _IEGetObjByName($Tmnx, "btnlogin")
  
 
    ;_IEAction($oLogIn, "click")
EndFunc

The msg box's are where the GUI should be.. Anyone have any ideas on the best way to go about this?

Share this post


Link to post
Share on other sites



Please simplify your question.


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

Share this post


Link to post
Share on other sites

Is there anyway i can make the ie embeded window reload with a different page after i click the $make button?

Share this post


Link to post
Share on other sites

like this?

#include <GUIConstants.au3>
#include <IE.au3>

_IEErrorHandlerRegister()

$oIE = _IECreateEmbedded()
GUICreate("Embedded Web control Test", 640, 580, _
        (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
        $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 600, 360)
$GUI_Button_Google = GUICtrlCreateButton("Google", 10, 420, 100, 30)
$GUI_Button_Yahoo = GUICtrlCreateButton("Yahoo", 120, 420, 100, 30)
$GUI_Button_AutoIt = GUICtrlCreateButton("AutoIt", 230, 420, 100, 30)
$GUI_Button_Stop = GUICtrlCreateButton("Stop", 340, 420, 100, 30)
GUISetState()
_IENavigate($oIE, "http://www.autoitscript.com")
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $GUI_Button_AutoIt
            _IENavigate($oIE, "http://www.autoitscript.com")
        Case $msg = $GUI_Button_Google
            _IENavigate($oIE, "www.google.com")
        Case $msg = $GUI_Button_Yahoo
            _IENavigate($oIE, "www.yahoo.com")
        Case $msg = $GUI_Button_Stop
            _IEAction($oIE, "stop")
    EndSelect
WEnd
GUIDelete()
Exit

Share this post


Link to post
Share on other sites

Well, kinda, But how the original script is set up that after i insert the answer for the captcha the gui disapears and inserts it to the page. I am implimenting it into a script that has the same page opened up 6 times. Each page having a different captcha. So, i need the gui to open the first time, showing the captcha to the first page, then after i hit "next" or w/e button i use, it opens the next IE window with another captcha in the gui window, doing this 6 times, then proceding with a script not involving this.

Share this post


Link to post
Share on other sites

anyone?

Share this post


Link to post
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
Sign in to follow this  
Followers 0