Eric 15 Posted March 14, 2010 Report Share Posted March 14, 2010 Hi, Okay, so let's say I want to use the manual captcha input (is there a effective solution currently that can replaced manual input?), how can I make the page loop back if the user keys in the wrong captcha so that the user can re-key in the captcha? But this is within a loop that the bot is going through the registration.eg: bot reads a list of sites and fill in the fields and call up the captcha if needed, but if there is captcha iput needed, and user key in wrongly, how can I make the bot go back to the current list item and let the user solve the captcha again and upon success, the bot will continue with the next list item of the loop of sites.I think this is something like a loop within a loop.. I'm scratching my head on this.. Quote Link to post Share on other sites
alcr 135 Posted March 14, 2010 Report Share Posted March 14, 2010 Loop $list totalMake the register part in a subset #url -> next list itemnav -> #urlfill in all fieldsif captcha - > run sub subchoose by attributedecaptcher chosen captcha (or just use a subwindow to almost any captcha service out there, nearly everyone uses a browser api)choose (text field where the captcha goes) by attributesend keys field chosen -> $captcha and then just click okay if search page 'captcha error'then run register sub Quote Link to post Share on other sites
sumpit 0 Posted March 15, 2010 Report Share Posted March 15, 2010 Please upload creenshot, thanks Quote Link to post Share on other sites
Eric 15 Posted March 16, 2010 Author Report Share Posted March 16, 2010 Loop $list totalMake the register part in a subset #url -> next list itemnav -> #urlfill in all fieldsif captcha - > run sub subchoose by attributedecaptcher chosen captcha (or just use a subwindow to almost any captcha service out there, nearly everyone uses a browser api)choose (text field where the captcha goes) by attributesend keys field chosen -> $captcha and then just click okay if search page 'captcha error'then run register sub Woot thanks so much.. will try out.. Quote Link to post Share on other sites
Eric 15 Posted March 16, 2010 Author Report Share Posted March 16, 2010 Loop $list totalMake the register part in a subset #url -> next list itemnav -> #urlfill in all fieldsif captcha - > run sub subchoose by attributedecaptcher chosen captcha (or just use a subwindow to almost any captcha service out there, nearly everyone uses a browser api)choose (text field where the captcha goes) by attributesend keys field chosen -> $captcha and then just click okay if search page 'captcha error'then run register sub How do I chose a "if captcha" command?I am using the "search for" command for a line of text (but I'm not sure if the line of text will be common through out).Is there any other command which is applicable for the bot to evaluate if a captcha is available, then go on to solve it? Also, does the "run sub" command needs to be placed in front (and not behind) of the "sub" command in order for the sub to be called. This is the sample site: http://skipjacknews.net/index.php/member/register/Below is my first try at writting some complicated commands (consider very complicated for me as I wasted many hrs scratching my head on this ), but thanks to the help of many helpful moderators here.. Can anyone help to see if any improvements needed to make it better or more tidy?.. My command is something like: clear listadd to list -> $list from file --start of loop--Loop $list total*sub registration*set #url -> next list itemnav -> #urlfill in all necessary fieldsif search page 'Submit the word you see below' - > run sub captcha *sub captcha*choose by attributedecaptcher chosen captchachoose (text field where the captcha goes) by attributesend keys field chosen -> $captcha choose agreed termsclick chosenchoose submitclick chosenwait finish (60secs) if search page 'You did not submit the word exactly as it appears in the image' - > run sub registration if search page 'Your registration has been successfully completed' - > save to file (eg. success.csv) if -> NOT -> eithersearch page 'You did not submit the word exactly as it appears in the image'search page 'Your registration has been successfully completed'-> save to file (eg. error.csv) --close of loop-- Also, I see that the run sub registration command is behind the intial *sub rgistration" node, so do I still need to place a run sub registration command at the top of the bot so that it will called the *sub rgistration node first.. confused.. Quote Link to post Share on other sites
Eric 15 Posted March 16, 2010 Author Report Share Posted March 16, 2010 if search page 'You did not submit the word exactly as it appears in the image' - > run sub registration if search page 'Your registration has been successfully completed' - > save to file (eg. success.csv) if -> NOT -> eithersearch page 'You did not submit the word exactly as it appears in the image'search page 'Your registration has been successfully completed'-> save to file (eg. error.csv) --close of loop-- Also, I see that the run sub registration command is behind the intial *sub rgistration" node, so do I still need to place a run sub registration command at the top of the bot so that it will called the *sub rgistration node first.. confused.. Seems something wrong here... Can I put 3 "if" commands and then proceed with the loop here?Is there a "OR" command or something that I need to put in between the "if" scenerios? Quote Link to post Share on other sites
alcr 135 Posted March 16, 2010 Report Share Posted March 16, 2010 "How do I chose a "if captcha" command?"Either just use a search command'if search page blablabla then do xyz'or just if choose by attribute captcha_image (if it can be chosen)then do xyz "Seems something wrong here... Can I put 3 "if" commands and then proceed with the loop here?"Yes, you can do that.If not search page blabla then do xyzIf not search page albalb then do xyzetc Quote Link to post Share on other sites
Eric 15 Posted March 16, 2010 Author Report Share Posted March 16, 2010 "How do I chose a "if captcha" command?"Either just use a search command'if search page blablabla then do xyz'or just if choose by attribute captcha_image (if it can be chosen)then do xyz "Seems something wrong here... Can I put 3 "if" commands and then proceed with the loop here?"Yes, you can do that.If not search page blabla then do xyzIf not search page albalb then do xyzetc The loop can't work.. How can I put in the "if not" commands? If not search page blabla then do xyzIf not search page albalb then do xyz I am trying to get the bot to search for 1) or 2) or 3) , then goes back to the start of the loop.1) search page aaa then run sub2) search page bbb then save file 13) if it isn't 1) or 2) then save file 2, and proceed to start of loop And also, there is an error trying to call the sub registration below.The registration is make as a sub in a loop, and the "run register sub" is only called again if search page 'captcha error', so how does that registration start to function first before it encounter the captcha error issue? Do I need to insert another "run register sub" node at the top of the loop? Loop $list totalMake the register part in a subset #url -> next list itemnav -> #urlfill in all fieldsif captcha - > run sub subchoose by attributedecaptcher chosen captcha (or just use a subwindow to almost any captcha service out there, nearly everyone uses a browser api)choose (text field where the captcha goes) by attributesend keys field chosen -> $captcha and then just click okay if search page 'captcha error'then run register sub Quote Link to post Share on other sites
alcr 135 Posted March 16, 2010 Report Share Posted March 16, 2010 Ahh, you probably just need if search page but 'not' is found under qualifiers, basically what you do is putting out an if statement, and in that one put a not statement. But I'm not sure what you mean with your second question? Basically you just put in a sub in the bottom of the script (could be placed anywhere, but I tend to put them there - just to get them out of harms way) and then whenever you want to run the sub, just use 'run sub'. Quote Link to post Share on other sites
theninjamanz 29 Posted March 16, 2010 Report Share Posted March 16, 2010 Take a step back for a minute. This is how I'd do it. Basically you're saying Run a setURL Sub.Here's you setup the URL that is being Navved to. Run a registration Sub(enter the details username etc.....could be a all the way up to the captcha) Run a "Is Captcha present" Sub.Checks to see whether a captcha is present on the page.IF YES Run Captcha Sub.If No Rub Submit sub. Run a captcha SubDoes the captcha Run a submit sub,Submit the form.IF search page ="the error message" Run Script Again.If search page ="congratulations" then add Current URL to list completed.txt and list position URLlist+1 + run script again. You can probably do this nicely with a loop. But loops always mess with me Quote Link to post Share on other sites
Psychotix 0 Posted March 22, 2010 Report Share Posted March 22, 2010 Hi I tried that specifically with Squidoo IF "error text" then run sub But it only repeats once or twice! What if I entered 3x or 4x wrong? How to make it loop indefinitely until I get the captcha right? Quote Link to post Share on other sites
bluegoat 24 Posted March 23, 2010 Report Share Posted March 23, 2010 Hi I tried that specifically with Squidoo IF "error text" then run sub But it only repeats once or twice! What if I entered 3x or 4x wrong? How to make it loop indefinitely until I get the captcha right?You could try the "while" command. Quote Link to post Share on other sites
Psychotix 0 Posted March 23, 2010 Report Share Posted March 23, 2010 You could try the "while" command. Yeah I tried that too. Heres my code. Maybe theres something wrong there. Tnx http://img399.imageshack.us/img399/2218/squidoocaptcha.jpg Quote Link to post Share on other sites
alcr 135 Posted March 23, 2010 Report Share Posted March 23, 2010 You need to chose the textfield where the captcha should go before sending the $captcha constant Quote Link to post Share on other sites
Psychotix 0 Posted March 23, 2010 Report Share Posted March 23, 2010 Oops missed that one. Thanks! Unfortunately I cant test that anymore because squidoo has this javascript code that messes with sendkeys and change attribute with captchas do I decided to pause on that part, manually encode captcha and proceed. But just to be clear. While and IF can make captchasolving loop indefinitely right?Because mine stops at 2-3 tries. Quote Link to post Share on other sites
alcr 135 Posted March 23, 2010 Report Share Posted March 23, 2010 Try turning off javascript completely and see how it'll react. But yes, it should loop indefinitely. I usually put the captcha breaking in a sub, and then an if statement in the end of the sub. If searchpage WRONG CAPTCHA then run sub Quote Link to post Share on other sites
theskinnys 1 Posted April 8, 2010 Report Share Posted April 8, 2010 "How do I chose a "if captcha" command?"Either just use a search command'if search page blablabla then do xyz'or just if choose by attribute captcha_image (if it can be chosen)then do xyz Just want to give a big thanks for this. I've been wondering how to do an if statement for a few things, especially captcha. Search page is extremely handicapped right now since it doesn't support wildcards, but doing 'if choose by attribute' then sending it off to a captcha service works perfectly. Quote Link to post Share on other sites
alcr 135 Posted April 8, 2010 Report Share Posted April 8, 2010 No problem I think I need to tell more people on how to use it that way. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.