Jump to content

I use IE Embed / Problem bloked the script .


Recommended Posts

I tray to auto login in my account of website , I use down script , the script work ok on yahoo E-mail but on another web , my account on another website , shee run up to "_IEFormSubmit ($oForm5)" then block the script . :) , what problem maybe to exist ?

Sorry for my bad language ..

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

_IEErrorHandlerRegister ()

$oIE = _IECreateEmbedded ()
GUICreate("E-mail", 900, 600, _
        (@DesktopWidth - 350) / 2, (@DesktopHeight - 300) / 2, _
        $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 850, 600)
$GUI_Button_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30)
$GUI_Button_Forward = GUICtrlCreateButton("Forward", 120, 420, 100, 30)

$bin = GUICtrlCreateButton("Start", 860, 5, 100, 30)




GUISetState()     ;Show GUI

_IENavigate ($oIE, "www.yahoo.com")



While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $bin

            
            $oForm5 = _IEFormGetCollection ($oIE, 0)
            $oName =_IEGetObjByName($oIE, "uname")
            $oPass = _IEGetObjByName($oIE, "password")
            
            _IEFormElementSetValue($oName, "username")
            _IEFormElementSetValue($oPass, "hdiskcndf")         
            _IEFormSubmit ($oForm5)
            
            Sleep(3000) 
        ;_IELinkClickByIndex($oIE, 3)

            _IENavigate($oIE, "http://www.yahoo.com")
                        
            Sleep(1000)
     

    EndSelect
WEnd

GUIDelete()

Exit
Link to comment
Share on other sites

There are few problem with this approach. First, the _IECreateEmbedded isn't using the InternetExplorer.Application object as _IECreate use and few problem may raise as a result of it. If some form or input use onsubmit or onclick something like '/click' or '/types/login.php' for example you'll see a white page with this string in it's top left side because the object that _IECreateEmbedded use is "Shell.Explorer.2" which means you'll need to go any reference in the source page and fix this by using the full url like "http://www.yahoo.com/click" or "http://www.yahoo.com/types/login.php.

Second problem is that some functions like the _IEFormSubmit can't (for some reason ;]) preform a proper wait before return (.busy status of the object) on the object therefore it's better not to use the default wait value (1) and instead use _IELoadWait($oIE) after the call. Other problems which will get post pretty long and boring took off for the simplicity of it.

Link to comment
Share on other sites

@Authenticity - there are certainly differences between InternetExplorer.Application and Shell.Explorer.2, but it has nothing to do with the issue raised here. The rest of your ramble in the first paragraph make no sense to me.

Please read the remarks in the helpfile for _IEFormSubmit which gives the advise in the second paragraph. Setting nowait for _IEFormSubmit and flollowing it up with _IELoadWait($oIE) is the most likely cause of trouble.

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

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