Jump to content

How to click a submit button in IE ?


Recommended Posts

I want to click a submit button, but there is no id or name.

I'm looking for button

<div class="btnCallafterQueue btn large"><a href="callRequest!exitQueue.do?callKeyCode=9e87eeb48af87909c80316993715c045" class="submitBtn">jetzt telefonieren</a><span></span></div>

This is the body of the page:

CODE
<body class="call">

<div id="mainWrapper">

<div id="statusBox"><div><span class="bold">Gesch&auml;tzte Wartezeit:</span> <span id="remainingTime"></span></div></div>

<div id="mainContent">

<div class="queue active">

<h1 class="indent">Bitte haben Sie etwas Geduld.</h1>

<p class="indent" style="width:20em;">Im Moment sind leider alle Leitungen belegt. Wir werden Sie jedoch so bald wie m&ouml;glich verbinden.<br /><a href="help.do?page=6#p6.1" class="cHelp" target="_blank">Mehr Infos</a></p>

<object type="application/x-shockwave-flash" data="swf/queue.swf" width="380" height="114" id="figures" name="figures">

<param name="movie" value="swf/queue.swf" />

</object>

<div class="clear queueSeparator"><hr /></div>

<div id="selfdial" class="selfdial" style="display:none;" >

<div class="fLeft indent">

<h1>Keine Lust zu warten?</h1>

<img src="images/common/selfdial_large.gif" width="244" height="183" alt="Bild Selbsteinwahl" style="padding-left:20px;" />

</div>

<div class="teaserSelfdial">

<p>Rufen Sie Peter doch einfach selbst unter seiner Einwahlnummer an und lassen sich von ihm kostenlos und ohne jegliches Warten weiterverbinden. Ideal f&uuml;r alle Besitzer einer Festnetzflat!<br /><a href="help.do?page=8" class="cHelp" target="_blank">Mehr Infos</a></p>

<div class="btn large fRight"><a href="callRequest!selectCallThru.do?callKeyCode=9e87eeb48af87909c80316993715c045" class="submitBtn">Selbsteinwahl verwenden</a><span></span></div>

</div>

<div class="clear"><hr /></div>

</div>

<iframe id="brandedJoker" src="http://www.peterzahlt.de/media/as/adif/frame.php?callphase=waiting&amp;logtxt=i-id%3a91922349&amp;passeiid=9e87eeb48af87909c80316993715c045&amp;mtype=swf.10.0.022&amp;mlang=de&amp;brand=&amp;registered=0&amp;aage=63&amp;asex=m&amp;abc=&amp;acc=49&amp;azip=85-81-8-82-80&amp;bbc=&amp;bcc=49&amp;bzip=85-81-8-82-80&amp;bposition=&amp;passlat=&amp;passlon=&amp;fwidth=814&amp;fheight=245&amp;view=center" width="814" height="245" frameborder="0" scrolling="no" allowtransparency="true"></iframe>

</div>

<div class="queue finished">

<h1 class="indent">Vielen Dank f&uuml;r Ihre Geduld.</h1>

<p class="indent">Bitte klicken Sie auf &quot;jetzt telefonieren&quot;, um kostenlos verbunden zu werden.</p>

<p class="bold indent">Automatischer Abbruch in <span id="abortTime">60</span> Sekunden</p>

<img src="images/common/queue-finished.gif" alt="" />

<div class="btnCallafterQueue btn large"><a href="callRequest!exitQueue.do?callKeyCode=9e87eeb48af87909c80316993715c045" class="submitBtn">jetzt telefonieren</a><span></span></div>

<div class="clear"><hr /></div>

<script type="text/javascript">

/* <![CDATA[ */

swfobject.embedSWF("swf/ringing.swf", "ringing", "1", "1", "09.0.115")

/* ]]> */

</script>

<div id="ringing"></div>

</div>

<div class="queue expired">

<h1 class="indent">Automatischer Abbruch</h1>

<p class="indent">Bitte klicken Sie auf &quot;zur&uuml;ck zur Startseite&quot; und initiieren Sie die Verbindung bei Interesse erneut. Herzlichen Dank!</p>

<img src="images/common/queue-expired.gif" alt="" />

<div class="btnCallafterQueue btn large inactive"><label>jetzt telefonieren</label><span></span></div>

<div class="clear"><hr /></div>

</div>

<div class="separator"><hr /></div>

<div class="btn btnIndent"><a href="index.do">zur&uuml;ck zur Startseite</a><span></span></div>

</div>

<div id="footer">

<ul class="hor">

<li><a href="http://www.goyellow.de" target="_blank">Telefonnummern suchen mit GoYellow.de</a></li><li><a href="http://www.peterpays.de" target="_blank">Unternehmen</a></li><li><a href="http://www.peterpays.de/index.php?page_id=8" target="_blank">Jobs</a></li><li><a href="imprint.do" rel="nofollow">Impressum</a></li><li class="last"><a href="anb.do" rel="nofollow" title="Allgemeine Nutzungsbedingungen">ANB</a></li>

</ul>

<p>&copy; 2009 PeterPays AG</p>

</div>

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">

</script>

<script type="text/javascript">

_uacct = "UA-1808735-1";

urchinTracker('CALL_queue');

</script>

</div>

</body>

Can you please give me a hint? :D

Edited by forumer100

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

Try this: It usually works

$oIE =_IECreate("https://webct.e-uni.com")
$hwnd = _IEPropertyGet($oIE, "hwnd")
ControlSend($hwnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}")

PS: DEbugBar is also your friend. its pretty useful tool if you do this kind of stuff.

Edited by goldenix
My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]
Link to comment
Share on other sites

I presume that since you are complaining that it has no name you were trying to ue _IEFormElementGetObjByName

Please read the Remarks for that function in the helpfile and it will steer you in the right direction.

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

Please refer to [help docs ] for example & detailed info on functions used here

For this case, since the submit control is actually a hyper-link, u may try _IELinkClickByText()

But the general method to do a submission is [1]to get the submission control[1] and [2]to do an _IEAction($submissionControl, "click") on it[2]

So, generally, we have to do [1] and [2]

[2] is simple - just put $submissionControl that u got from [1] - just so

[1] is the problem of identification - there are 3 built-in functions to deal with this

a/_IEFormGetObjByName --- b/_IEGetObjByName --- c/_IEGetObjById

a/ to deal with a submission in a form --- while --- b/, c/ to deal with an outside one

- u can also identify a submission control through some of its UNIQUE attributes

here I give an example to idenfify a submission control through its "href" attribute (as long as this attribute exists, it is almost obvious to be UNIQUE to controls)

Func LinkClickByHref(ByRef $oIE, $href)

; BIG NOTICE ; get all links on page

$oLinks = _IELinkGetCollection ($oIE)

;$iNumLinks = @extended

;MsgBox(0, "Link Info", $iNumLinks & " links found")

$count = 0

For $oLink In $oLinks

;MsgBox(0, $count & " Link Info", $oLink.href)

; BIG NOTICE ; get link by href

If $oLink.href = $href Then

; BIG NOTICE ; this is number [2]

_IEAction ($oLink, "click")

Return True

EndIf

$count += 1

Next

Return False

EndFunc

Link to comment
Share on other sites

@ 'LubeLee'

many thanks for your information. This helped me to identify the submit button. :D

Now there is a problem. The button seems to be invisible at page load and appears later when the queue has expired. So I clicked the button too early.

I assume that there is a property of the submitbutton object who describes if it is visible or not. How can i detemine all the property names of an object?

Is there any tool or documentation where i can read?

I would like to do e.g.:

consolwrite(@cr & $oLink.href )

consolwrite(@cr & $oLink.visible ) ; just a guess

consolwrite(@cr & $oLink.hidden ) ; just a guess

consolwrite(@cr & $oLink.font ) ; just a guess

consolwrite(@cr & $oLink.??? )

consolwrite(@cr & $oLink.??? ) ; where to get those names ???

TIA forumer100

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

DebugBar shows you dynamic source (view source does not). Try it out. The source for the link or something it is contained within will give you more clues (note that it may not be invisible, it may be created when it is needed).

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

DebugBar shows you dynamic source (view source does not). Try it out.

Dale, many thanks for your valuable contributions. I really like your efforts in this forum regarding IE. :D

I use DebugBar already extensivly. But here is a drawback: The button shows only for 30 seconds to prepare a connection. If not pressed, the attempt is cancelled and a new page is shown. This time span is too short for me to debug the information, since I'm visually impaired and cannot analyze as quickly. :D

My approach would be to analyze the properties of the submitbutton object. I want to check what changes when appearing on the screen. I want to consolwrite the properties during the session and press a hotkey when the button appears. Then I can find out the property to test on.

So, the current question in this thread is: What are the properties of a submitbutton, and more important: Where to get those information? This would help me to solve such problems myself in the future. I used Google and MSDN, but had no luck. Seems to be too stupid to find the correct search words?

Perhaps, someone can enlighten me. ;)

App: Au3toCmd              UDF: _SingleScript()                             

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