pezo89 Posted March 20, 2010 Share Posted March 20, 2010 Hi guys, where just wondering is there a way to read the form iv added as a picture?iv tried the helpfile, and other projects iv done before but without success source; <tr> <td><span class="mandatorymarker"><img src="http://cache.finn.no/img/mandatorymarker.gif" alt="" width="12" height="12" /></span></td> <td>Ditt navn:</td> <--NAME <td> <input size='50' maxlength='95' id='name' type="text" name="#name#" /> </td> </tr> <tr> <td><span class="mandatorymarker"><img src="http://cache.finn.no/img/mandatorymarker.gif" alt="" width="12" height="12" /></span></td> <td>Din epost adresse <span class="comment">(Kopi sendes)</span>:</td> <--EMAIL <td> <input size='50' maxlength='95' id='email' type="text" name="from" /> <input type="hidden" name="copyToSender" value="true" /> </td> </tr> <tr> <td></td> <td>Telefon:</td> <--PHONE <td> <input size='50' maxlength='95' id='phone' type="text" name="#Telephone#" value="" /> </tr> <tr> <td><span class="mandatorymarker"><img src="http://cache.finn.no/img/mandatorymarker.gif" alt="" width="12" height="12" /></span></td> <td>Emne:</td> <td> <input size='50' maxlength='95' id='subject' type="text" name="#subject#" value="Søknad på stillingen: Kundeservice medarbeider" /> </td> </tr> <tr> <td valign="top"><span class="mandatorymarker"><img src="http://cache.finn.no/img/mandatorymarker.gif" alt="" width="12" height="12" /></span></td> <td valign="top">Meldingstekst:<p/> <span class="comment">(Kort melding til mottager)</span> </td> <td><textarea rows='5' cols='37' id='message' name="#message#"></textarea></td> </tr> </tbody> </table> <table> <tbody> <tr> <td><a href="javascript:history.go(-1)" class="button">Tilbake</a></td> <td width="320"></td> <td align="right"><input alt="Send Søknad" name="send" class="button" id='applyNow' type="submit" value="Send Søknad" onclick="javascript:setFormAction('applynow','/finn/jobs/applynow/send?');document.forms.applynow.encoding='application/x-www-form-urlencoded';"/></td> </tr> </tbody> </table> </form> <br clear="all"> </div> Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 20, 2010 Share Posted March 20, 2010 Looks very straight forward. Did you get the object references to the input tags and use them with _IEFormElementSetValue()? Where's the code you tried? What happened when you tried it? 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 Link to comment Share on other sites More sharing options...
pezo89 Posted March 21, 2010 Author Share Posted March 21, 2010 Global $Paused sleep ("1000") HotKeySet("{Pause}", "TogglePause") HotKeySet("{Insert}", "Terminate") send ("{Pause}") #include <IE.au3> $oIE = _IEAttach ("http://www.finn.no/finn/jobs/applynow") $oForm = _IEFormGetObjByName ($oIE, "applynow") $oText = _IEFormElementGetObjByName ($oForm, "name") _IEFormElementSetValue ($oText, "Test1234") Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) toolTip('Script - "Scriptet er - AV"',0, 40) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFuncLooks very straight forward. Did you get the object references to the input tags and use them with _IEFormElementSetValue()? Where's the code you tried? What happened when you tried it? nothing happens =/ and as i can't see what exactly i am doing wrong i aint getting anywhere Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 21, 2010 Share Posted March 21, 2010 #include <IE.au3> $oIE = _IEAttach ("http://www.finn.no/finn/jobs/applynow") $oForm = _IEFormGetObjByName ($oIE, "applynow") $oText = _IEFormElementGetObjByName ($oForm, "name") _IEFormElementSetValue ($oText, "Test1234") nothing happens =/ and as i can't see what exactly i am doing wrong i aint getting anywhere First, the default mode for _IEAttach() is the document title. If you want to use the URL, it must be specified. Second, there is no error checking in your script. Test @error and/or check the returned values from functions before using them. In the case of _IE* functions, put _IEErrorHandlerRegister() at the top of your script and watch the SciTE console for lots of details on what fails. This should get you closer: #include <IE.au3> _IEErrorHandlerRegister() $sURL = "http://www.finn.no/finn/jobs/applynow" $oIE = _IEAttach($sURL, "url") If Not @error Then $oForm = _IEFormGetObjByName($oIE, "applynow") $oText = _IEFormElementGetObjByName($oForm, "name") _IEFormElementSetValue($oText, "Test1234") EndIf 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 Link to comment Share on other sites More sharing options...
pezo89 Posted March 26, 2010 Author Share Posted March 26, 2010 thx alot! helps alot,but one tiny question, how can i select the bla gjennom tab? in english it is browse, and upload file system, searched the source, and all i can find on it is useraction and upload.. managed to work the input.. so far iv tried the :click by index, - it does work, sort of, but still abit of missclicks becouse of the change of total amounts of index links, :click by text, -ain't got it to work, what should i use for this purpose?, once it is clicked it opens window containing files on my comp, where i am to located spesific files in a folder, witch i can do, once that button has been pushed Thx in advance!. and thanks again for the help! Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 26, 2010 Share Posted March 26, 2010 Use a DOM Inspector, like DebugBar for IE, to see what the path to that button looks like. I see the button you are talking about in the picture, but not in the HTML you posted, but you didn't post it all (and don't need to - you can read it as easily as I can). 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 Link to comment Share on other sites More sharing options...
pezo89 Posted March 26, 2010 Author Share Posted March 26, 2010 well i got the name and the value for it, isent that enough to push it? .. in the same way i can submit a form for example? Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 26, 2010 Share Posted March 26, 2010 well i got the name and the value for it, isent that enough to push it? .. in the same way i can submit a form for example?No.You have to ID the form before submitting it. If the form is inside another form, that's inside a frame, that's in a frame set, etc., then you won't submit it until you drill down to it in the DOM.A button in a web form is not same as a control in a GUI. It's not like ControlClick() with just a control ID to know which one it is. A DOM Inspector would show you what parent elements the button comes under. 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now