murdock Posted February 13, 2008 Share Posted February 13, 2008 (edited) Im making a pretty simple automation for Facebook, but I ran into a problem with a Submit button in a form. The relevant html: <form action="process_pillaging_results.php" method="post"> <input type="submit" value="Attack!" /> I was hoping there was a way to use an _IE function to submit this. I couldnt figure it out when I looked through the Help index. Im about to experiment a bit with _IELinkGetCollection(), but I dont have to much hope for this. Any ideas? Edited February 13, 2008 by murdock Link to comment Share on other sites More sharing options...
jokke Posted February 13, 2008 Share Posted February 13, 2008 Im pretty sure its something like _IEFormSubmit($oIE,-1) when there is no form to attach to. UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt. Link to comment Share on other sites More sharing options...
murdock Posted February 13, 2008 Author Share Posted February 13, 2008 That gives me an error:C:\Program Files\AutoIt3\Include\IE.au3 (1154) : ==> The requested action with this object has failed.: $o_col = $o_object.document.forms.item ($s_Name) $o_col = $o_object.document.forms.item ($s_Name)^ ERROR->AutoIT3.exe ended.rc:1Im thinking it would be easier to just use _IENavigate()Im gonna look up what gets passed when you submit a form, and just try to duplicate it.Any other ideas? Or if anyone knows what gets passed when you submit a form that would help me google less, lol. Link to comment Share on other sites More sharing options...
Danp2 Posted February 13, 2008 Share Posted February 13, 2008 Did you try something like this? $oForm = _IEFormGetCollection ($oIE, 0) _IEFormSubmit ($oForm) Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
murdock Posted February 13, 2008 Author Share Posted February 13, 2008 (edited) Dan:That seems to submit something, which moves the link along and keeps the script going.However, it does not go to the correct page, so its not submitting the same as if I had clicked the actual button.The FormSubmit actually did the same thing as an _IENavigate to the next page (ie. http://example.com/next.php) when it needs something like... http://example.com/next.php?submit=ATTACKI dont know all the data it requests though, so I am unable to finish the link by hand =[Is it possible to just recreate the form, give names to the form and submit button, and then send that new form?I would approach it like this:$sSource = _INetGetSource($oIE)$sLoc = StringInStr($sSource, "method=\"post\" ")_StringInsert($sSource, "name = \"submit\" ", $sLoc)Hope Im still on the right track Edit: The escape characters dont work, wtf? Edited February 13, 2008 by murdock Link to comment Share on other sites More sharing options...
Danp2 Posted February 14, 2008 Share Posted February 14, 2008 Read the helpfile entry for _IEAction. Using this, you should be able to simulate clicking the Submit button. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
murdock Posted February 14, 2008 Author Share Posted February 14, 2008 I would love to click the submit button... the whole problem is that I cant click it through _IEAction() unless Im missing something? I pasted the html of the form and submit button so if you could show me how to do it Id love that T.T Link to comment Share on other sites More sharing options...
DaleHohm Posted February 14, 2008 Share Posted February 14, 2008 (edited) Im about to experiment a bit with _IELinkGetCollection(), but I dont have to much hope for this.Why is it you have little hope for that? It is the suggested way to get references to objects without ID or NAMEs. If it is the first form on the page and the submit button is the first element in the form: $oForm = _IEFormGetCollection($oIE, 0) $oSubmit = _IEFormElementGetCollection($oForm, 0) _IEAction($oSubmit, "click") If this doesn't work for you, check to insure your document elements are not inside Frames or iFrames (see _IEFrame* functions) and post your code, description of what happens and messages from the SciTe console. Dale Edit: typo Edited February 14, 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 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