Jump to content
Sign in to follow this  
pezo89

Ie input??

Recommended Posts

Hi, i cant get this to work lol..

input in IE, what to use?? tried the _IEFormElementGetObjByName

but thats not working

i am trying to make a script that writes onto the input bare on sites like this

ref: https://colorline.easycruit.com/vacancy/application/815129ee09492b0a923b6c56d7385e56/452443/37714

fornavn: - First name

mellomnavn: - surname

etternavn: - Lastname

and so on..

anyone who can just bump me in the right direction, and no i do not want you to build the script for me or anything lol =)

in advance, thx alot for any help / responses given.

Share this post


Link to post
Share on other sites

Something like this should work:

$oIE=_IECreate("https://colorline.easycruit.com/")
    $oDoc = _IEDocGetObj($oIE)
    $oArray = $oDoc.getElementsByTagName ("input") ;similar to _IEFormElementGetObjByName
    For $element In $oArray
        If $element.Name = "username"  Then _IEFormElementSetValue($element, $user)
        If $element.Name = "password"  Then _IEFormElementSetValue($element, $pass)
        If $element.Value = "Sign In"  Then _IEAction($element, "click") ; be careful - the button should be the last element from the 3 - usually is
    Next
    _IELoadWait($oIE)

Share this post


Link to post
Share on other sites

seems i cannot link the site itself so il just copy the source.

looks like this

Edited by pezo89

Share this post


Link to post
Share on other sites

<DIV id=application_form>
<FORM name=preview action=/vacancy/application/815129ee09492b0a923b6c56d7385e56/452443/37714 method=post target=_blank><INPUT type=hidden value=true name=preview> <INPUT type=hidden value=no name=iso> </FORM>
<FORM name=cv action=/vacancy/application/815129ee09492b0a923b6c56d7385e56/452443/37714 method=post encType=multipart/form-data><INPUT type=hidden name=delete_item> <INPUT type=hidden value=2 name=view_page> <INPUT type=hidden value=2 name=current_page> <INPUT type=hidden value=homepage name=channel> <INPUT type=hidden value=no name=iso> 
<TABLE class=margins width="96%">
<TBODY>
<TR>
<TD>
<TABLE class=appframe style="BORDER-COLLAPSE: collapse" cellPadding=0 width="82%">
<TBODY>
<TR>
<TD>
<TABLE class=login-header style="BORDER-COLLAPSE: collapse" cellPadding=10 width="100%">
<TBODY>
<TR>
<TD class=login-header-text style="PADDING-LEFT: 30px">Du søker på stillingen "Ekstrahjelp/Helgevikarer Oslo-Kiel linjen" </TD>
<TD class=login-header-text style="PADDING-RIGHT: 6px; PADDING-LEFT: 6px; PADDING-BOTTOM: 6px; PADDING-TOP: 6px" align=right><IMG class=rightimg alt="" src="/images/logo/37713/logo.jpg"> </TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD>
<TABLE class=appmenu style="BORDER-COLLAPSE: collapse" cellPadding=0 width="100%">
<TBODY>
<TR>
<TD class=unselected-tab style="BORDER-COLLAPSE: collapse" vAlign=center noWrap align=middle width="16%" height=30>&nbsp;&nbsp;Personverngaranti&nbsp;&nbsp;</TD>
<TD class=selected-tab style="BORDER-COLLAPSE: collapse" vAlign=center noWrap align=middle width="16%" height=30>&nbsp;&nbsp;Personalia&nbsp;&nbsp;</TD>
<TD class=unselected-tab style="BORDER-COLLAPSE: collapse" vAlign=center noWrap align=middle width="16%" height=30>&nbsp;&nbsp;Utdanning og erfaring&nbsp;&nbsp;</TD>
<TD class=unselected-tab style="BORDER-COLLAPSE: collapse" vAlign=center noWrap align=middle width="16%" height=30>&nbsp;&nbsp;Kurs og Kompetanse&nbsp;&nbsp;</TD>
<TD class=unselected-tab style="BORDER-COLLAPSE: collapse" vAlign=center noWrap align=middle width="16%" height=30>&nbsp;&nbsp;Diverse&nbsp;&nbsp;</TD>
<TD class=unselected-tab style="BORDER-COLLAPSE: collapse" vAlign=center noWrap align=middle width="16%" height=30>&nbsp;&nbsp;Søknad&nbsp;&nbsp;</TD>
<TD class=unselected-tab style="BORDER-COLLAPSE: collapse" vAlign=center noWrap align=middle width="16%" height=30>&nbsp;&nbsp;Login informasjon&nbsp;&nbsp;</TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD>
<TABLE class=appmain style="BORDER-COLLAPSE: collapse" width="100%">
<TBODY>
<TR>
<TD width="1%" height=350></TD>
<TD vAlign=top align=left height=350>
<H2 class=category>Personalia</H2><INPUT type=hidden value=1 name=form_submit> 
<TABLE border=0>
<TBODY>
<TR>
<TD vAlign=top align=left width=300>Fornavn:&nbsp;<FONT color=red>*</FONT>&nbsp; </TD>
<TD vAlign=top align=left><INPUT size=26 name=field_1_2> </TD></TR>
<TR>
<TD vAlign=top align=left width=300>Mellomnavn:&nbsp; </TD>
<TD vAlign=top align=left><INPUT size=26 name=field_1_3> </TD></TR>
<TR>
<TD vAlign=top align=left width=300>Etternavn:&nbsp;<FONT color=red>*</FONT>&nbsp; </TD>
<TD vAlign=top align=left><INPUT size=26 name=field_1_4> </TD></TR>
<TR>
<TD vAlign=top align=left width=300>Kjønn:&nbsp;<FONT color=red>*</FONT>&nbsp; </TD>
<TD vAlign=top align=left><INPUT type=radio value=m name=field_1_5>&nbsp;Mann<BR><INPUT type=radio value=f name=field_1_5>&nbsp;Kvinne<BR></TD></TR>
<TR>
<TD vAlign=top align=left width=300>Fødselsdato:&nbsp;<FONT color=red>*</FONT>&nbsp; </TD>
<TD vAlign=top align=left><SELECT name=field_1_6_date> <OPTION value="" selected>- Dag -</OPTION> <OPTION value=01>01</OPTION> <OPTION value=02>02</OPTION> <OPTION value=03>03</OPTION> <OPTION value=04>04</OPTION> <OPTION value=05>05</OPTION> <OPTION value=06>06</OPTION> <OPTION value=07>07</OPTION> <OPTION value=08>08</OPTION> <OPTION value=09>09</OPTION> <OPTION value=10>10</OPTION> <OPTION value=11>11</OPTION> <OPTION value=12>12</OPTION> <OPTION value=13>13</OPTION> <OPTION value=14>14</OPTION> <OPTION value=15>15</OPTION> <OPTION value=16>16</OPTION> <OPTION value=17>17</OPTION> <OPTION value=18>18</OPTION> <OPTION value=19>19</OPTION> <OPTION value=20>20</OPTION> <OPTION value=21>21</OPTION> <OPTION value=22>22</OPTION> <OPTION value=23>23</OPTION> <OPTION value=24>24</OPTION> <OPTION value=25>25</OPTION> <OPTION value=26>26</OPTION> <OPTION value=27>27</OPTION> <OPTION value=28>28</OPTION> <OPTION value=29>29</OPTION> <OPTION value=30>30</OPTION> <OPTION value=31>31</OPTION></SELECT> <SELECT name=field_1_6_month> <OPTION value="" selected>- Måned -</OPTION> <OPTION value=01>Januar</OPTION> <OPTION value=02>Februar</OPTION> <OPTION value=03>Mars</OPTION> <OPTION value=04>April</OPTION> <OPTION value=05>Mai</OPTION> <OPTION value=06>Juni</OPTION> <OPTION value=07>Juli</OPTION> <OPTION value=08>August</OPTION> <OPTION value=09>September</OPTION> <OPTION value=10>Oktober</OPTION> <OPTION value=11>November</OPTION> <OPTION value=12>Desember</OPTION></SELECT> <SELECT name=field_1_6_year> <OPTION value=""; </TD>
<TD vAlign=top align=left><INPUT maxLength=15 size=15 name=field_1_27> </TD></TR>
<TR>
<TD vAlign=top align=left width=300>Nasjonalitet:&nbsp;<FONT color=red>*</FONT>&nbsp; </TD>
<TD vAlign=top align=left><SELECT name=field_1_7> <OPTION value="";<FONT color=red>*</FONT>&nbsp; </TD>
<TD vAlign=top align=left><INPUT size=26 name=field_1_8> </TD></TR>
<TR>
<TD vAlign=top align=left width=300>Gjenta e-postadressen:&nbsp;<FONT color=red>*</FONT>&nbsp; </TD>
<TD vAlign=top align=left><INPUT size=26 name=field_1_25> </TD></TR>
<TR>
<TD vAlign=top align=left width=300>Telefon privat:&nbsp;<FONT color=red>*</FONT>&nbsp; </TD>
"this.value = this.value.replace(/[^+\d]/,''); this.value = this.value.replace(/(.)\+/,'$1');" onmouseover="ddrivetip('Velg landskode i nedtrekksmenyen, og legg til telefonnummeret uten å benytte lokale prefix, som f.eks. (0).')" onmouseout=hideddrivetip() size=12 name=field_1_10> </TD></TR>
<TR>
<TD vAlign=top align=left width=300>Telefon mobil:&nbsp; </TD>
"this.value = this.value.replace(/[^+\d]/,''); this.value = this.value.replace(/(.)\+/,'$1');" onmouseover="ddrivetip('Velg landskode i nedtrekksmenyen, og legg til telefonnummeret uten å benytte lokale prefix, som f.eks. (0).')" onmouseout=hideddrivetip() size=12 name=field_1_11> </TD></TR>
<TR>
<TD vAlign=top align=left width=300>Adresse:&nbsp;<FONT color=red>*</FONT>&nbsp; </TD>
<TD vAlign=top align=left><INPUT size=26 name=field_1_13> </TD></TR>
<TR>
<TD vAlign=top align=left width=300>Postnummer:&nbsp;<FONT color=red>*</FONT>&nbsp; </TD>
<TD vAlign=top align=left><INPUT size=5 name=field_1_14> </TD></TR>
<TR>
<TD vAlign=top align=left width=300>Poststed:&nbsp;<FONT color=red>*</FONT>&nbsp; </TD>
<TD vAlign=top align=left><INPUT size=26 name=field_1_15> </TD></TR>
<TR>
<TD vAlign=top align=left width=300>Land:&nbsp;<FONT color=red>*</FONT>&nbsp; </TD>
<TD vAlign=top align=left><SELECT onchange="updateCounty('field_1_16','field_1_17');" name=field_1_16> <OPTION value="";<FONT color=red>*</FONT>&nbsp; </TD>
<TD vAlign=top align=left><SELECT name=field_1_19><OPTION value=0 selected>- Velg -</OPTION> <OPTION value=9>Enke/Enkemann</OPTION> <OPTION value=2>Gift</OPTION> <OPTION value=3>Samboer</OPTION> <OPTION value=8>Skilt</OPTION> <OPTION value=4>Ugift</OPTION></SELECT> </TD></TR>
<TR>
<TD vAlign=top align=left width=300>Yrkesstatus:&nbsp;<FONT color=red>*</FONT>&nbsp; </TD>
<TD vAlign=top align=left><SELECT name=field_1_20><OPTION value=0 selected>- Velg yrkesstatus -</OPTION> <OPTION value=3>Arbeidsledig</OPTION> <OPTION value=17>Engasjement</OPTION> <OPTION value=8>Fast deltid</OPTION> <OPTION value=4>Fast heltid</OPTION> <OPTION value=7>Freelance</OPTION> <OPTION value=5>Næringsdrivende</OPTION> <OPTION value=11>Permisjon</OPTION> <OPTION value=18>Sesongansatt</OPTION> <OPTION value=2>Student</OPTION> <OPTION value=10>Vikariat deltid</OPTION> <OPTION value=9>Vikariat heltid</OPTION></SELECT> </TD></TR>
<TR>
<TD vAlign=top align=left width=300>Legg ved bilde av deg selv ( .jpg / .gif ):&nbsp; </TD>
<TD vAlign=top align=left>
<script language=javascript>
function UploadWait_1_21 () {
    document.getElementById("status_text_1_21").style.display='block';
    document.getElementById("status_image_1_21").style.display='block';
}
</SCRIPT>

<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD vAlign=top align=left><INPUT type=file name=field_1_21></TD>
<TD>&nbsp;</TD>
<TD vAlign=top align=left><INPUT class=addbutton onclick=UploadWait_1_21(); type=submit value="Last opp" name=upload_button_field_1_21></TD>
<TD vAlign=center align=right><SPAN id=status_text_1_21 style="DISPLAY: none"><I>Laster opp - vennligst vent</I></SPAN></TD>
<TD vAlign=center><SPAN id=status_image_1_21 style="DISPLAY: none"><IMG src="https://www.easycruit.com/images/icons/pleaseWaitPlain.gif"></SPAN></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD vAlign=top align=left width=300>Last opp CV:&nbsp; </TD>
<TD vAlign=top align=left>
<script language=javascript>
function UploadWait_1_22 () {
    document.getElementById("status_text_1_22").style.display='block';
    document.getElementById("status_image_1_22").style.display='block';
}
</SCRIPT>

<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD vAlign=top align=left><INPUT type=file name=field_1_22></TD>
<TD>&nbsp;</TD>
<TD vAlign=top align=left><INPUT class=addbutton onclick=UploadWait_1_22(); type=submit value="Last opp" name=upload_button_field_1_22></TD>
<TD vAlign=center align=right><SPAN id=status_text_1_22 style="DISPLAY: none"><I>Laster opp - vennligst vent</I></SPAN></TD>
<TD vAlign=center><SPAN id=status_image_1_22 style="DISPLAY: none"><IMG src="https://www.easycruit.com/images/icons/pleaseWaitPlain.gif"></SPAN></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD vAlign=top align=left width=300>Jeg ønsker å motta en kopi av min søknad via e-post:&nbsp; </TD>
<TD vAlign=top align=left><INPUT type=radio value=y name=field_1_28>&nbsp;Ja<BR><INPUT type=radio value=n name=field_1_28>&nbsp;Nei<BR></TD></TR></TBODY></TABLE><BR><BR></TD>
<TD width="1%" height=350></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD>
<TABLE class=appfoot style="BORDER-COLLAPSE: collapse" cellPadding=0 width="100%">
<TBODY>
<TR>
<TD width="1%" height=40>&nbsp; </TD>
<TD vAlign=center align=left width="20%"><INPUT class=navbutton onclick="javascript:if(confirm('Er du sikker på at du vil avbryte? Vinduet vil bli lukket og alle data du har lagt inn vil gå tapt!')){window.close();}" type=button value=Avbryt name=close> </TD>
<TD align=middle><SPAN class=asterix>*</SPAN>&nbsp;Alle felt som er merket med rød stjerne må fylles ut&nbsp;<SPAN class=asterix>*</SPAN> </TD>
<TD vAlign=center align=right width="20%"><INPUT class=navbutton onclick="gopage('1')" type=button value=Tilbake name=b_next> <INPUT class=navbutton onclick="gopage('3')" type=button value=Neste name=b_next> </TD>
<TD width="1%"></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></FORM></DIV>

Share this post


Link to post
Share on other sites

try this :

#include <IE.au3>
$_fornavn='First name'
$_mellomnavn='surname'
$_etternavn='Lastnam'

$oIE=_IECreate ( "C:\Documents and Settings\Administrateur\Bureau\1.html", 1 )
    $oDoc = _IEDocGetObj($oIE)
    $oArray = $oDoc.getElementsByTagName ("input") ;similar to _IEFormElementGetObjByName
    For $element In $oArray
        ConsoleWrite ( "$element.Name : " & $element.Name & @Crlf )
        If $element.Name = 'field_1_2'  Then _IEFormElementSetValue ( $element, $_fornavn )
        If $element.Name = 'field_1_3'  Then _IEFormElementSetValue ( $element, $_mellomnavn )
        If $element.Name = 'field_1_4'  Then _IEFormElementSetValue ( $element, $_etternavn )       
    Next
    _IELoadWait($oIE)

replace C:\Documents and Settings\Administrateur\Bureau\1.html by your url i can't connect !

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

try this :

#include <IE.au3>
$_fornavn='First name'
$_mellomnavn='surname'
$_etternavn='Lastnam'

$oIE=_IECreate ( "C:\Documents and Settings\Administrateur\Bureau\1.html", 1 )
    $oDoc = _IEDocGetObj($oIE)
    $oArray = $oDoc.getElementsByTagName ("input") ;similar to _IEFormElementGetObjByName
    For $element In $oArray
        ConsoleWrite ( "$element.Name : " & $element.Name & @Crlf )
        If $element.Name = 'field_1_2'  Then _IEFormElementSetValue ( $element, $_fornavn )
        If $element.Name = 'field_1_3'  Then _IEFormElementSetValue ( $element, $_mellomnavn )
        If $element.Name = 'field_1_4'  Then _IEFormElementSetValue ( $element, $_etternavn )       
    Next
    _IELoadWait($oIE)

replace C:\Documents and Settings\Administrateur\Bureau\1.html by your url i can't connect !

thx alot, works like a charm :)

edited abit, but how can i select a radio the array way ? ;)

removed my personal information that is typed in =)

Global $Paused
sleep ("1000")
HotKeySet("{|}", "TogglePause")
HotKeySet("{ESC}", "Terminate")

#include <IE.au3>
$_fornavn=''
$_mellomnavn=''
$_etternavn=''
$_Epost=''
$_telefon=''
$_adresse='7'
$_Postnummer=''
$_Sted=''


$oIE=_IECreate ( "https://colorline.easycruit.com/vacancy/application/84959de90abfe0e3eabbed10b2e70412/452443/37714", 1 )
send ("{|}")
$oDoc = _IEDocGetObj($oIE)
    $oArray = $oDoc.getElementsByTagName ("input") ;similar to _IEFormElementGetObjByName
    For $element In $oArray
        ConsoleWrite ( "$element.Name : " & $element.Name & @Crlf )
        If $element.Name = 'field_1_2'  Then _IEFormElementSetValue ( $element, $_fornavn )
        If $element.Name = 'field_1_3'  Then _IEFormElementSetValue ( $element, $_mellomnavn )
        If $element.Name = 'field_1_4'  Then _IEFormElementSetValue ( $element, $_etternavn )
        If $element.Name = 'field_1_8'  Then _IEFormElementSetValue ( $element, $_Epost )
        If $element.Name = 'field_1_25'  Then _IEFormElementSetValue ( $element, $_Epost )
        If $element.Name = 'field_1_10'  Then _IEFormElementSetValue ( $element, $_telefon )
        If $element.Name = 'field_1_11'  Then _IEFormElementSetValue ( $element, $_telefon )
        If $element.Name = 'field_1_13'  Then _IEFormElementSetValue ( $element, $_adresse )
        If $element.Name = 'field_1_14'  Then _IEFormElementSetValue ( $element, $_Postnummer )
        If $element.Name = 'field_1_15'  Then _IEFormElementSetValue ( $element, $_Sted )
        If $element.Name = 'field_1_15'  Then _IEFormElementSetValue ( $element, $_Sted )
        If $element.Name = 'field_1_5'  Then _IEFormElementSetValue ( $element, $_Sted )
        _IEFormElementCheckboxSelect ($element, "m", "", 0, "byValue")  <----


    Next
    _IELoadWait($oIE)

Exit

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ;toolTip('Script -  "Scriptet er - AV"',0, 40)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()

    Exit 0
EndFunc
Edited by pezo89

Share this post


Link to post
Share on other sites

It's not _IEFormElementCheckboxSelect

but _IEFormElementRadioSelect function

Read the source code of the page for get informations

<TD vAlign=top align=left><INPUT type=radio value=m name=field_1_5>&nbsp;Mann<BR><INPUT type=radio value=f name=field_1_5>&nbsp;Kvinne<BR></TD></TR>

or

<TD vAlign=top align=left><INPUT type=radio value=y name=field_1_28>&nbsp;Ja<BR><INPUT type=radio value=n name=field_1_28>&nbsp;Nei<BR></TD></TR></TBODY></TABLE><BR><BR></TD>


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

It's not _IEFormElementCheckboxSelect

but _IEFormElementRadioSelect function

Read the source code of the page for get informations

yea, but im trying to implent it it into the script itself. but i cannot get the shit to work ;) lol :)

should't it be like this??

_IEFormElementRadioSelect ($oIE, "m", "radio", 1, "byValue")

or am i far off here? :S

Share this post


Link to post
Share on other sites

How about:

_IEFormElementRadioSelect($oForm, "m", "field_1_5", 1, "byValue", 1)

The object reference is to the form.

The radio group is called "field_1_5".

The particular element in the group is called "m".

;)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

How about:

_IEFormElementRadioSelect($oForm, "m", "field_1_5", 1, "byValue", 1)

The object reference is to the form.

The radio group is called "field_1_5".

The particular element in the group is called "m".

;)

well do i se the $oForm as $oForm = 'url'?

or is there another way? as il be using this code (when done) on diffrent pages, it is kinda bad if it looks for a spesific form.. :S

read trough some of the ie radio posts here, and the helpfile. but cant seem to find a clear solution.. =S

Share this post


Link to post
Share on other sites

well do i se the $oForm as $oForm = 'url'?

or is there another way? as il be using this code (when done) on diffrent pages, it is kinda bad if it looks for a spesific form.. :S

read trough some of the ie radio posts here, and the helpfile. but cant seem to find a clear solution.. =S

Try again in English, or maybe with a better translator.

Not sure what you are saying, but $oForm is an object reference to the form element, usually retrieved with _IEFormGetObjByName(), or _IEFormGetCollection() with an index. See help file.

;)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

well the easiest way to explain it is to just try to do just that..

what i am trying to do, is to add an action to the script above,

to have the script check the IE radio element called

m with the name of 'Field_1_5'

Share this post


Link to post
Share on other sites

If by "check" you meant select the radio element, then what I posted in #11 should work. Provided the $oForm object is valid.

If by "check" you meant "see if it's selected or not", then use the same function with the fourth parameter = -1. That will return the current state of the radio element. See the help file under _IEFormElementRadioSelect().

The first step is to get a valid reference to the form that contains this radio element in $oForm.

This gave me the impression you didn't do that:

well do i se the $oForm as $oForm = 'url'?

;)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...