Código: Seleccionar todo
#include <IE.au3>
$oIE = _IECreate ("http://forums.linkbucks.com/")
$oForm = _IEFormGetCollection ($oIE, 0)
$oQuery = _IEFormElementGetCollection ($oForm, 0)
$oQuery2 = _IEFormElementGetCollection ($oForm, 2)
_IEFormElementSetValue ($oQuery, "usuario")
_IEFormElementSetValue ($oQuery2, "contraseña")
_IEFormSubmit ($oForm)
Sleep(10000);preferíria no tener que depender de esto :P
_IELinkClickByText ($oIE, "Log Out")
Sleep(10000);preferíria no tener que depender de esto :P
Send("{ENTER}")
Código: Seleccionar todo
Remarks
_IEAttach provides the "dialogbox" parameter to attach to modal and modeless dialogs created by the browser. It is important to note that not all dialogs created through browser interaction can be attached to and controlled in this way. Many of these dialogs are actually standard windows and can be controlled through the traditional AutoIt window functions. A reliable way to tell the difference between these types of windows is to use the "AutoIt Window Info" tool to examine it -- if the window contains a control called "Internet Explorer_Server" then you can attach to it with this function, if it does not it is a standard window and traditional AutoIt windows functions must be used to control it.
PD: Probé con otro código usando funciones de _IE Management (por más que no creo que me sirvan porque me parece que es una ventana de windows lo que me aparece y no una interna del explorador) y me dio estos errores:
Código: Seleccionar todo
#include <IE.au3>
$oIE = _IECreate ("http://forums.linkbucks.com/")
$oForm = _IEFormGetCollection ($oIE, 0)
$oQuery = _IEFormElementGetCollection ($oForm, 0)
$oQuery2 = _IEFormElementGetCollection ($oForm, 2)
_IEFormElementSetValue ($oQuery, "usuario")
_IEFormElementSetValue ($oQuery2, "contraseña")
_IEFormSubmit ($oForm)
Sleep(10000)
_IELinkClickByText ($oIE, "Log Out")
$oIE2 = _IEAttach ("Windows Internet Explorer", "dialogbox")
_IEAction ($oIE2, "focus")
ControlSend("Windows Internet Explorer", "Aceptar", 1, "{ENTER}")
Código: Seleccionar todo
>"C:\Archivos de programa\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Documents and Settings\Pablo\Escritorio\TEST PARA DESLOGUEARME 2.au3" /autoit3dir "C:\Archivos de programa\AutoIt3" /UserParams
+>13:16:09 Starting AutoIt3Wrapper v.2.0.0.1 Environment(Language:0C0A Keyboard:0000040A OS:WIN_XP/Service Pack 3 CPU:X86 OS:X86)
>Running AU3Check (1.54.14.0) from:C:\Archivos de programa\AutoIt3
+>13:16:09 AU3Check ended.rc:0
>Running:(3.3.0.0):C:\Archivos de programa\AutoIt3\autoit3.exe "C:\Documents and Settings\Pablo\Escritorio\TEST PARA DESLOGUEARME 2.au3"
--> IE.au3 V2.4-0 Error from function _IEAction, $_IEStatus_InvalidObjectType
+>13:17:04 AutoIT3.exe ended.rc:0
+>13:17:05 AutoIt3Wrapper Finished
>Exit code: 0 Time: 57.401