Sign in to follow this  
Followers 0
cburak

IE.au3 Clicking a Button behind Picture

1 post in this topic

#1 ·  Posted (edited)

(I solved myself - Sorry to disturb you. I should look more before asking for help)

Solution:

Local $oInput, $oInputs = _IETagNameGetCollection($oIELogin, 'input')
    For $oInput In $oInputs
        If String($oInput.alt) = "giris" Then
            _IEAction($oInput, "click")
        EndIf
    Next

Hello.

Iam trying to login a website automatically but I cannot click login. Here is the webpage HTML:

<tbody><tr>
    <td height="25" align="left" background="../images/baslik.gif"><span class="style13">&nbsp; :: Öğrenci Girişi </span></td>
  </tr>
<form name="frmLogin" action="login.asp" method="post"></form>
  <tr>
    <td width="204" align="center" valign="top"><table width="100%" border="0" cellpadding="1" cellspacing="1">
      <tbody><tr>
        <td width="44%"><span class="style17">Kullanıcı Adı : </span></td>
        <td width="56%"><input name="frmName" type="text" size="8"></td>
      </tr>
      <tr>
        <td><span class="style17">Şifre : </span></td>
        <td><input name="frmPass" type="password" size="8"></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><input type="image" src="../images/cmdtamam.jpg" alt="giris" width="67" height="22" style="border:none"></td>
      </tr>
    </tbody></table></td>
  </tr>
<input type="hidden" name="submit" value="1"><input type="hidden" name="frmTip" value="3">

 <tr>
    <td height="25" align="left"><hr size="1"></td>
  </tr>
  <!--<tr>
    <td height="25" align="left" valign="top" background="../images/baslik.gif"><span class="style13">&nbsp; » Anket </span></td>
  </tr>
  <tr>
    <td align="center" valign="top"><table width="100%" border="0" cellpadding="1" cellspacing="1">
      <tr>
        <td colspan="2"><span class="style17">Anket sorusu burada sorulacak ? </span></td>
      </tr>
      <tr>
        <td><input name="radiobutton" type="radio" value="radiobutton"></td>
        <td class="style2">1. Seçenek </td>
      </tr>
      <tr>
        <td><input name="radiobutton" type="radio" value="radiobutton"></td>
        <td class="style2">2. Seçenek </td>
      </tr>
      <tr>
        <td width="18%"><span class="style17">
          <input name="radiobutton" type="radio" value="radiobutton">
        </span></td>
        <td width="82%" class="style2">3. Seçenek </td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td align="right"><img src="../images/dugme_tamam.gif" alt="giris" width="67" height="22"></td>
      </tr>
    </table></td>
  </tr>-->
  
</tbody>

I have succesfully set the forms but can not submit it.

$i=_IEGetObjByName($oIELogin,"frmName")
    _IEFormElementSetValue($i,$username)
    $i=_IEGetObjByName($oIELogin,"frmPass")
    _IEFormElementSetValue($i,$password)

I have no idea which one should I click or how to click it:

<form name="frmLogin" action="login.asp" method="post"></form>

or

<input type="image" src="../images/cmdSubmit.jpg" alt="giris" width="67" height="22" style="border:none">

or

<input type="hidden" name="submit" value="1">

or

<input type="hidden" name="frmTip" value="3">

I have tried so many combinations but here is my last part of code for click:

$oSubmit = _IEGetObjByName($oIELogin,"submit")
    $oSubmit.click

        $osubmit = _IEformgetobjbyname($oIE,"frmLogin")
    _IEFormSubmit($oSubmit)

    $oFormLogin = _IEFormGetObjByName($oIELogin,"frmLogin")
    _IEAction($oFormLogin,"click")

    _IEImgClick($oIELogin,"giris","alt",0,1)

2. mini question. is there a any difference between :

_IEFormGetObjByName

_IEGetObjByName

for getting this obj:

<form name="frmLogin" action="login.asp" method="post"></form>

 

Any help much appreciated:)

 

Edit: Code view

Edited by cburak

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