Cnotey 3 Posted December 18, 2015 Report Share Posted December 18, 2015 Hi there, So I'm working with a site that uses Google's new recaptcha. I don't always get hit with it. But I was wondering if there is a way to have a define command stop if it detects (element) for the recaptcha, let me pick the pictures, and then click a button to continue the script? I have been successful in making it wait for the checkbox to be checked, but I can't seem to interact with the browser while it's waiting. Does anyone have a way to solve this? Thanks, Cnotey Quote Link to post Share on other sites
itexspert 47 Posted December 18, 2015 Report Share Posted December 18, 2015 Use Alert Command so this is how it works: Inside the Define use this logic somewhere in your loop: if {Image ExistsThen {Alert,"Enter Recaptcha Code"Else {$Nothing} I know syntax isn't correct but that is the general idea of how it works you see When you use Alert command, Script automatically stops and waits for User Input,and then once you enter the desired text you click Ok and Script Continues.... Quote Link to post Share on other sites
Cnotey 3 Posted December 18, 2015 Author Report Share Posted December 18, 2015 Yea I thought about using that logic. But can you click on things while before you click the alert OK button? I need to manually solve the recaptcha before I continue the script. It's been my previous experience you can't interact with the browser while the alert window is active. Edit: Just tested it and I was correct. You cannot interact with a browser window while the alert prompt is open. Quote Link to post Share on other sites
Cnotey 3 Posted December 18, 2015 Author Report Share Posted December 18, 2015 What I am trying to get around is this: http://www.google.com/recaptcha/api2/demo Quote Link to post Share on other sites
cүвεя_נυηкιε 68 Posted December 18, 2015 Report Share Posted December 18, 2015 Yep, .... When it detects the captcha set a variable #capdone "false"Then enter a Loop While #capdone = "false" Inside that Loop While add something like : If "checkbox is checked" Then set #capdone "true"Else "" This way you can complete the captcha in 2 ways, Manually via the browserVia UI Html window (you MUST use a Base64 string for the image AND a "Global" variable for the image) If you use the browser no extra coding is needed, f you use a UI Html window then you have to set up some extra switches etc.. I have a demo video from one of my bots showing manual reCaptcha v2 image captcha'sif i find it ill post it here for you. CheersCJ Quote Link to post Share on other sites
pash 504 Posted December 19, 2015 Report Share Posted December 19, 2015 Not sure if this is what you want.The example below is waiting And automatically stop waitingIt will wait either.1. Wait for the timeout 180 seconds.2. Wait until the "element" that needs to disappear. ui stat monitor("Status:",#Status) navigate("http://www.google.com/recaptcha/api2/demo","Wait") wait for browser event("Everything Loaded","") wait(1) if($exists(<class="recaptcha-checkbox-checkmark">)) { then { set(#TimeOut,180,"Global") loop while($both($exists(<class="recaptcha-checkbox-checkmark">),$comparison(#TimeOut,">= Greater than or equal to",0))) { decrement(#TimeOut) set(#Status,"Captcha detected/Time out: {#TimeOut}","Global") wait(1) } } else { set(#Status,"Undetected Captcha","Global") } } 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.