Jump to content

IE Basic Task


Terenz
 Share

Recommended Posts

Hello. I need to "automize" an intranet website, some task nothing too difficult but seems i can't. I need to:

1) Write on an inputbox

2) Click on a button

3) Get text from an editbox

I'm stuck with the first :(

The main problem is i can't get any form ( using example from the help at _IEFormGetCollection in For...Loop ) but at least i know the name of the input:

<input name="TxTInput" type="text" id="TxTInput" style="font-size:Smaller;width:60px;">

What i need to do?

Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Link to comment
Share on other sites

_IEGetObjById
_IEPropertySet ;"innertext" value for property paramenter should work

These should work for you

P.S: why can't you get any form?

Edited by j0kky
Link to comment
Share on other sites

Nope

#include <IE.au3>

$oIE = _IECreate("mysite")
Local $oDiv = _IEGetObjById($oIE, "TxTInput")
ConsoleWrite($oDiv & @CRLF)
_IEPropertySet($oDiv, "innertext", "Look What I can Do")

_IEGetObjById return zero. Seems the input is inside a table:

table id="TableMain" cellspacing="0" cellpadding="6" border="0" style="border-color:#FFCC00;border-width:1px;border-style:solid;width:430px;border-collapse:collapse;">

Does matter?

P.S: why can't you get any form?

I don't have any idea, the function _IEFormGetCollection rertun the message There are 0 form(s) on this page

Edited by Terenz

Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Link to comment
Share on other sites

How i can know if is a Frame or iFrame?  :sweating:

With this script i can get all element of the Frame ( There is only 1 Frame ):

Local $oFrames = _IEFrameGetCollection($oIE)
Local $iNumFrames = @extended
Local $sTxt = $iNumFrames & " frames found" & @CRLF & @CRLF
Local $oFrame = 0
For $i = 0 To ($iNumFrames - 1)
    $oFrame = _IEFrameGetCollection($oIE, $i)
    $sTxt &= _IEPropertyGet($oFrame, "innertext") & @CRLF
Next
MsgBox(0, "Frames Info", $sTxt)

_IEQuit($oIE)

Like the label, drop menu etc. but how to get the inputbox and set a text?

Edited by Terenz

Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Link to comment
Share on other sites

Look through the HTML source, and check if one of your nodes ancestors is a <Frame> or <iFrame>.

If it is, in the loop you just posted, use:

$oYourobject = _IEGetObjById($oFrame,"yourNameYouWantToGet")
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
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...