Gillboss Posted October 27, 2008 Posted October 27, 2008 i looked for the file help of: "_IEFormGetObjByName" and i understand theat can get the form obj by name.. but at this codes, i dont see any name.. btw, i need to press the "Deposit" button.. <form action="http://apps.facebook.com/inthemafia/bank.php" method="post"><input type="hidden" name="fb_sig_locale" value="en_US" /><input type="hidden" name="fb_sig_in_new_facebook" value="1" /><input type="hidden" name="fb_sig_time" value="1225144339.854" /><input type="hidden" name="fb_sig_added" value="1" /><input type="hidden" name="fb_sig_profile_update_time" value="1222821946" /><input type="hidden" name="fb_sig_expires" value="1225230739" /><input type="hidden" name="fb_sig_user" value="1371913276" /><input type="hidden" name="fb_sig_session_key" value="3d667f03c410fa26a26f4711-1371913276" /><input type="hidden" name="fb_sig_api_key" value="63eade489b31633f81a5cd776197cc65" /><input type="hidden" name="fb_sig" value="c419ff31963842856a7cb405401c12f3" /> Amount: <input name="amount" type="text" value="0" /> <input type="hidden" value="Deposit" name="action" /> <input type="submit" name="do" value="Deposit" /> thanks
Moderators big_daddy Posted October 28, 2008 Moderators Posted October 28, 2008 If it is the first or only form on the page then you can use the following. $oForm = _IEFormGetCollection($oIE, 0)
Gillboss Posted October 28, 2008 Author Posted October 28, 2008 If it is the first or only form on the page then you can use the following. $oForm = _IEFormGetCollection($oIE, 0) no its not.. there more forms
walle Posted October 28, 2008 Posted October 28, 2008 (edited) some1? I'm surprised how quickly I forget things.... Anyway, increase the number until you find the right form, as temporary solution. Form 1 $oForm = _IEFormGetCollection($oIE, 1) Edited October 28, 2008 by walle
Gillboss Posted October 28, 2008 Author Posted October 28, 2008 I'm surprised how quickly I forget things.... Anyway, increase the number until you find the right form, as temporary solution. Form 1 $oForm = _IEFormGetCollection($oIE, 1) ok i try to thx
Gillboss Posted October 28, 2008 Author Posted October 28, 2008 (edited) ok i found.. it was the number 2, but i have more problem:i need to press on the submit button of:<FORM action=http://apps.facebook.com/inthemafia/jobs.php method=post><INPUT type=hidden value=en_US name=fb_sig_locale><INPUT type=hidden value=1 name=fb_sig_in_new_facebook><INPUT type=hidden value=1225226707.4464 name=fb_sig_time><INPUT type=hidden value=1 name=fb_sig_added><INPUT type=hidden value=1222821946 name=fb_sig_profile_update_time><INPUT type=hidden value=1225313107 name=fb_sig_expires><INPUT type=hidden value=1371913276 name=fb_sig_user><INPUT type=hidden value=f62025ef8a2b25b986c056ce-1371913276 name=fb_sig_session_key><INPUT type=hidden value=63eade489b31633f81a5cd776197cc65 name=fb_sig_api_key><INPUT type=hidden value=bdaa4328e6147b080cb124ac93cf7eae name=fb_sig> <INPUT type=hidden value=28 name=job> <INPUT type=submit value="Do Job" name=action> </FORM>and its another button, just for information..all the buttons are almost same..<FORM action=http://apps.facebook.com/inthemafia/jobs.php method=post><INPUT type=hidden value=en_US name=fb_sig_locale><INPUT type=hidden value=1 name=fb_sig_in_new_facebook><INPUT type=hidden value=1225226707.5222 name=fb_sig_time><INPUT type=hidden value=1 name=fb_sig_added><INPUT type=hidden value=1222821946 name=fb_sig_profile_update_time><INPUT type=hidden value=1225313107 name=fb_sig_expires><INPUT type=hidden value=1371913276 name=fb_sig_user><INPUT type=hidden value=f62025ef8a2b25b986c056ce-1371913276 name=fb_sig_session_key><INPUT type=hidden value=63eade489b31633f81a5cd776197cc65 name=fb_sig_api_key><INPUT type=hidden value=17b06c6bb8788eb2675d2ce0ffedf02f name=fb_sig> <INPUT type=hidden value=27 name=job> <INPUT type=submit value="Do Job" name=action> </FORM>btw, here is link for print screen: Edited October 28, 2008 by Gillboss
walle Posted October 28, 2008 Posted October 28, 2008 Okey, get the right form, and use _IEFormSubmit. Hopefully Dale, the king of IE, or someone ells with a little more experience can help you. I have not touched Autoit for over a year now. So, I'm a bit rusty $oForm = _IEFormGetCollection($oIE, 0) _IEFormSubmit ($oForm)
Gillboss Posted October 28, 2008 Author Posted October 28, 2008 Okey, get the right form, and use _IEFormSubmit. Hopefully Dale, the king of IE, or someone ells with a little more experience can help you. I have not touched Autoit for over a year now. So, I'm a bit rusty $oForm = _IEFormGetCollection($oIE, 0) _IEFormSubmit ($oForm)oÝ÷ Ûú®¢×¦zËb«^×è®Ø^¶¼¢
DaleHohm Posted October 28, 2008 Posted October 28, 2008 (edited) @Gillboss - you've posted HTML but no AutoIt code you've tried yet. Please work through some _IE examples and try some things and post what you have. Particularly, look at _IEFormSubmit example or perhaps _IEGetObjByName and _IEAction, click. Dale p.s. I see now that you've posted some code. Make sure you look at the output in the SciTe console and also explain what happens, please don't just say it "doesn't work". Edited October 28, 2008 by DaleHohm 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
Gillboss Posted October 28, 2008 Author Posted October 28, 2008 (edited) @Gillboss - you've posted HTML but no AutoIt code you've tried yet. Please work through some _IE examples and try some things and post what you have. Particularly, look at _IEFormSubmit example or perhaps _IEGetObjByName and _IEAction, click. Dale p.s. I see now that you've posted some code. Make sure you look at the output in the SciTe console and also explain what happens, please don't just say it "doesn't work". the "what happens" is that its didnt click any button. its clicked only on search button if i put number 0 in IEFormGetCollection i tried it: $website = "http://apps.facebook.com/inthemafia/jobs.php" Sleep(1000) Dim $oIE=_IECreate($website,1,1,0) _IELoadWait ($oIE) $oSubmit = _IEGetObjByName ($oIE, "action") _IEAction ($oSubmit, "click") _IELoadWait($oIE) Its did the first job, because all the buttons have same name, but few difference things, example: Job 1: <INPUT type=hidden value=1 name=job> <INPUT type=submit value="Do Job" name=action> <INPUT type=hidden value=92a4417dc0c9153db87bcbbb30b5bb6a name=fb_sig> Job 7: and other button: <INPUT type=hidden value=7 name=job> <INPUT type=submit value="Do Job" name=action> <INPUT type=hidden value=6fbcfc5edb7353a783608bf6fd8f206f name=fb_sig> Edited October 28, 2008 by Gillboss
Gillboss Posted October 28, 2008 Author Posted October 28, 2008 hmmmm i make it: $website = "http://apps.facebook.com/inthemafia/jobs.php" Sleep(1000) Dim $oIE=_IECreate($website,1,1,0) _IELoadWait ($oIE) $oElements = _IETagNameAllGetCollection($oIE) $sum = 1 For $oElement In $oElements If $sum = 4 Then ExitLoop If StringInStr($oElement.tagname, "INPUT") Then If StringInStr($oElement.type, "Submit") And StringInStr($oElement.value, "Do Job") Then $oLogin=$oElement $sum+=1 EndIf EndIf Next _IEAction($oLogin, 'Click') i use $sum for count the value... and i think its work.. i will continue tommorow good night!
Gillboss Posted October 29, 2008 Author Posted October 29, 2008 (edited) i need help.. i try to get this: <DIV class=title_tab><A class=tab_title href="http://apps.facebook.com/inthemafia/#">Capo Jobs</A><BR><A class=tab_subtitle href="http://apps.facebook.com/inthemafia/#">(Levels 13 - 17)</A></DIV> but script dont get it.. $website = "http://apps.facebook.com/inthemafia/jobs.php" Sleep(1000) Dim $oIE=_IECreate($website,1,1,0) _IELoadWait ($oIE) $oElements = _IETagNameAllGetCollection($oIE) For $oElement In $oElements If StringInStr($oElement.value, "Capo Jobs") Then $oLogin=$oElement EndIf Next _IEAction($oLogin, 'Click') _IELoadWait($oIE) _IEQuit($oIE) how solve? Edited October 29, 2008 by Gillboss
DaleHohm Posted October 30, 2008 Posted October 30, 2008 why not just _IELinkClickByText($oIE, "Capo Jobs") ?? 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
Gillboss Posted October 30, 2008 Author Posted October 30, 2008 why not just_IELinkClickByText($oIE, "Capo Jobs")??cooool ty =]
Gillboss Posted October 30, 2008 Author Posted October 30, 2008 (edited) why its not working to me? Func Job($KindOfWork, $NumOfJob) $website = "http://apps.facebook.com/inthemafia/jobs.php" Dim $oIE=_IECreate($website,1,1,0) _IELoadWait ($oIE) _IELinkClickByText($oIE, $KindOfWork&" Jobs") _IELoadWait($oIE) $oElements = _IETagNameAllGetCollection($oIE) $sum = 1 For $oElement In $oElements If $sum = $NumOfJob Then ExitLoop If StringInStr($oElement.tagname, "INPUT") Then If StringInStr($oElement.type, "Submit") And StringInStr($oElement.value, "Do Job") Then $oLogin=$oElement $sum+=1 EndIf EndIf Next _IEAction($oLogin, 'Click') _IELoadWait ($oIE) _IEQuit($oIE) EndFunc oh nvm.. i was just need to add sleep(5000). Edited October 31, 2008 by Gillboss
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