Jump to content
UBot Underground

How to insert a captcha loop back if wrong captcha is input


Recommended Posts

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..

Link to post
Share on other sites

Loop $list total

Make the register part in a sub

set #url -> next list item

nav -> #url

fill in all fields

if captcha - > run sub

 

sub

choose by attribute

decaptcher 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 attribute

send keys field chosen -> $captcha

 

and then just click okay

 

if search page 'captcha error'

then run register sub

Link to post
Share on other sites

Loop $list total

Make the register part in a sub

set #url -> next list item

nav -> #url

fill in all fields

if captcha - > run sub

 

sub

choose by attribute

decaptcher 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 attribute

send 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.. :)

Link to post
Share on other sites

Loop $list total

Make the register part in a sub

set #url -> next list item

nav -> #url

fill in all fields

if captcha - > run sub

 

sub

choose by attribute

decaptcher 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 attribute

send 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 :P ), 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 list

add to list -> $list from file

 

--start of loop--

Loop $list total

*sub registration*

set #url -> next list item

nav -> #url

fill in all necessary fields

if search page 'Submit the word you see below' - > run sub captcha

 

*sub captcha*

choose by attribute

decaptcher chosen captcha

choose (text field where the captcha goes) by attribute

send keys field chosen -> $captcha

 

choose agreed terms

click chosen

choose submit

click chosen

wait 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 -> either

search 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..

Link to post
Share on other sites

 

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 -> either

search 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?

Link to post
Share on other sites

"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 xyz

If not search page albalb then do xyz

etc

Link to post
Share on other sites

"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 xyz

If not search page albalb then do xyz

etc

 

The loop can't work..

 

How can I put in the "if not" commands?

 

If not search page blabla then do xyz

If 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 sub

2) search page bbb then save file 1

3) 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 total

Make the register part in a sub

set #url -> next list item

nav -> #url

fill in all fields

if captcha - > run sub

 

sub

choose by attribute

decaptcher 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 attribute

send keys field chosen -> $captcha

 

and then just click okay

 

if search page 'captcha error'

then run register sub

Link to post
Share on other sites

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'.

Link to post
Share on other sites

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 Sub

Does 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 :)

Link to post
Share on other sites

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?

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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 :)

Link to post
Share on other sites
  • 3 weeks later...

"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.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...