Jump to content

Skip html code within a script - (Locked)


Dranka
 Share

Recommended Posts

Hello,

I've some forms to fill on a website but unfortunately 2 forms has been copied pasted by the developper so they have the exact same id and value and so on ...

I admit autoit is ready the html code line by line so he's filling the first form but he's skipping the second one.
Is there a way to skip the first form or to fill both while they have same id ?

Here is the html code :

<form id="form_jeu" action="/jeu/verif_jeu.php" method="post" enctype="multipart/form-data">
      <p align="center"><input class="input obg" name="code_jeu" id="code_jeu" type="text" onkeyup="verifPseudo444(this)" placeholder="Entrer le code"/>
      <input type="hidden" name="id" value="444"/>
      <input type="hidden" name="doubs" value="1"/>
      <input type="hidden" name="jura" value="1"/>
      <input type="hidden" name="id_user" value="19123"/>
      <br/>
      <input type="submit" name="valider_code" id="valider_code" value="valider le code"/></p>
    </form>
<form id="form_jeu" action="/jeu/verif_jeu.php" method="post" enctype="multipart/form-data">
      <p align="center"><input class="input obg" name="code_jeu" id="code_jeu" type="text" onkeyup="verifPseudo449(this)" placeholder="Entrer le code"/>
      <input type="hidden" name="id" value="449"/>
      <input type="hidden" name="doubs" value="1"/>
      <input type="hidden" name="jura" value="1"/>
      <input type="hidden" name="id_user" value="19123"/>
      <br/>
      <input type="submit" name="valider_code" id="valider_code" value="valider le code"/></p>
    </form>

Here is my script

 

#include <ie.au3>

;Declare Variables=============================================

$URL="random url"

$code_jeu="random code"

$codejeu="code_jeu"


;===============================================================

Func _Fill_Name_Code()
   $oForm = _IEGetObjById($oIE, "form_jeu")       ;you need this to declare the form you want to fill. the form ID is form1 as you can see in the html code


    $oCode = _IEFormElementGetObjByName($oForm, $codejeu)
    _IEFormElementSetValue($oCode, $code_jeu)



EndFunc


Func _Click_Upload()

$oButtons = _IETagnameGetCollection($oIE, "input")
For $oButton in $oButtons
    If String($oButton.value) = "valider le code" Then
        _IEAction($oButton, "click")
        ExitLoop
    EndIf
Next

EndFunc

While 1
Do
    $oIE = _IECreate($Url,0,1,1,0)
 Until IsObj($oIE)


_Fill_Name_Code() ;We call the Func



_IELoadWait($oIE,500000)
_IEQuit($oIE)
WEnd

Thank you

Link to comment
Share on other sites

  • Developers

Welcome to the AutoIt forum.

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

The Moderation team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...