Defiled 424 Posted March 1, 2020 Hello, This is a snippet on solving 2Captcha using Selenium, you of course need 3 classes to use this (HttpWrapper, TwoCaptchaService, ProxyType) which are found in the 2Captcha Java API. private void solveCaptcha(String apiKey, String pageUrl, String siteKey) { TwoCaptchaService service = new TwoCaptchaService(apiKey, siteKey, pageUrl); try { String responseToken = service.solveCaptcha(); if(responseToken.equals("ERROR_CAPTCHA_UNSOLVABLE")) { System.out.println("Unable to solve.. Resolving.. "); solveCaptcha(apiKey, pageUrl, siteKey); } else { System.out.println("Solved and Generated Response Token.. "+responseToken); JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript("document.getElementById('g-recaptcha-response').innerHTML = '" + responseToken + "';"); js.executeScript("onSubmit()"); } } catch (IOException e) { e.printStackTrace(); } } If the page does not contain the callback function onSubmit() or contains it but within an anonymous function, you have 2 ways to do it: /* Using the Browser console find the lettering that points to the anonymous function and replace cl.J with yours. */ js.executeScript("___grecaptcha_cfg.clients[0].cl.J.callback(\"" + responseToken + "\")"); OR /* This simply calls back any callback method it finds. */ js.executeScript("document.getElementById('callback').call();"); I hope this helps someone improvements are welcome
Eclipseop 194 Posted March 1, 2020 hello Good squire! I am here to inform u that using selenium is so 2017 l00l
Defiled 424 Author Posted March 2, 2020 11 hours ago, Eclipseop said: hello Good squire! I am here to inform u that using selenium is so 2017 l00l It's open for anyone to use, Mr. Otter. If you wanna use Selenium, go for it.. If you wanna use Apache HTTP go for it.. if you wanna use a Toaster go for it.. PST: The same code can be applied to other software... you just have to change the way it executes the Javascript code. Kind Regards, The Good Squire
kamilo 7 Posted May 3, 2020 On 3/2/2020 at 2:03 AM, Defiled said: It's open for anyone to use, Mr. Otter. If you wanna use Selenium, go for it.. If you wanna use Apache HTTP go for it.. if you wanna use a Toaster go for it.. PST: The same code can be applied to other software... you just have to change the way it executes the Javascript code. Kind Regards, The Good Squire whats the lastest, most efficient methodology rather than using selenium cuz its free there have to be some better cost-efficient methods
m4rr3co 67 Posted May 9, 2020 On 3/1/2020 at 5:02 PM, Eclipseop said: hello Good squire! I am here to inform u that using selenium is so 2017 l00l what's the 2020 method? x_x
m4rr3co 67 Posted May 11, 2020 On 3/1/2020 at 11:30 AM, Defiled said: Hello, This is a snippet on solving 2Captcha using Selenium, you of course need 3 classes to use this (HttpWrapper, TwoCaptchaService, ProxyType) which are found in the 2Captcha Java API. private void solveCaptcha(String apiKey, String pageUrl, String siteKey) { TwoCaptchaService service = new TwoCaptchaService(apiKey, siteKey, pageUrl); try { String responseToken = service.solveCaptcha(); if(responseToken.equals("ERROR_CAPTCHA_UNSOLVABLE")) { System.out.println("Unable to solve.. Resolving.. "); solveCaptcha(apiKey, pageUrl, siteKey); } else { System.out.println("Solved and Generated Response Token.. "+responseToken); JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript("document.getElementById('g-recaptcha-response').innerHTML = '" + responseToken + "';"); js.executeScript("onSubmit()"); } } catch (IOException e) { e.printStackTrace(); } } If the page does not contain the callback function onSubmit() or contains it but within an anonymous function, you have 2 ways to do it: /* Using the Browser console find the lettering that points to the anonymous function and replace cl.J with yours. */ js.executeScript("___grecaptcha_cfg.clients[0].cl.J.callback(\"" + responseToken + "\")"); OR /* This simply calls back any callback method it finds. */ js.executeScript("document.getElementById('callback').call();"); I hope this helps someone improvements are welcome little doubt, how do you get the "driver" variable inside the function? do you send it as a parameter?
Eclipseop 194 Posted May 13, 2020 On 5/9/2020 at 7:37 PM, m4rr3co said: what's the 2020 method? x_x maybe one of the bajillions of open source ones xddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd https://github.com/search?q=runescape+account+creator
m4rr3co 67 Posted May 13, 2020 2 minutes ago, Eclipseop said: maybe one of the bajillions of open source ones xddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd https://github.com/search?q=runescape+account+creator jesus, so many solutions ahahha thanks a bunch bro =D
Recommended Posts
Archived
This topic is now archived and is closed to further replies.