Code Monkey home page Code Monkey logo

ozgurkayaist / google-recaptcha-solver-seleniumautomation Goto Github PK

View Code? Open in Web Editor NEW
45.0 2.0 15.0 5.78 MB

2Captcha.com's API used for solving Google's Invisible Recaptcha and Recaptcha v2 with Java. Should click the right images to user verify and check I am not robot.

License: Apache License 2.0

Java 100.00%
2captcha recaptcha selenium java recaptcha-verification recaptcha-v3 recaptchav2 recaptcha-v2-captcha-solver recaptcha-v2 recaptcha-bypass-script

google-recaptcha-solver-seleniumautomation's Introduction

Google Recaptcha Solver Selenium Test Automation

alt text

2Captcha.com's API used for solving Google's Invisible Recaptcha and Recaptcha v2 with Java Selenium Chrome Browser Test Automation.

  • Should solve image challenges
  • Should retry for image challenges
  • Should click I am no robot checkbox
  • Should response to invisible captcha forms

Google has a demo website that includes a dummy form. This example has been tested on this demo website. url without querystring will show I am not robot. You should add "?invisible=true" at the end of the following url. When invisible=true there will be an extra request to 2captcha.com for resolution of the invisible captcha. This repository is compatible with all Google Recaptcha types.

https://www.google.com/recaptcha/api2/demo

What do you need to start?

  • https://2captcha.com/ Account with minimum 3$ balance for 1000 Recaptcha. (Starting from 0.5 USD for 1000 solved CAPTCHAs by data entry workers)
  • Development needs Java JDK v1.8.0, Maven, IntelliJ (preferable IDE)

You should also:

  • Change configuration and site settings from "src\test\resources\config.properties" file.
  • Use 2captcha.com Sandbox mode (for developers) for image selection challenges.
  • Use proxy settings for test automation running (not required, but recommended).

Why do we need 2captcha.com API services?

Because, you can not fight with Google. You need to analyze and decide to answer like a human. If you have a software that has artificial intelligence and learns continuously, everything changes. All of these solutions are of course paid.

2captcha.com solves different types of captchas:

Normal Captcha, Text Captcha, ReCaptcha V2, ReCaptcha V3, GeeTest, ReCaptcha V2 (old method), Solving ClickCaptcha, RotateCaptcha, FunCaptcha, FunCaptcha Token Method, KeyCaptcha, hCaptcha

To start using 2captcha.com service:

Service provides an API that allows you to solve different types of captchas.

  • Register 2captcha.com
  • Implement 2captcha.com API
  • Send 2captcha.com your CAPTCHAs
  • Get your answer / directions as text.

Other popular alternatives

  • anti-captcha.com
  • deathbycaptcha.com
  • azcaptcha.com

How to configure?

Chrome Browser Driver
  • You have to download the correct driver for your operating system. There are 3 versions of the driver (Windows/Linux/Mac) https://chromedriver.chromium.org/downloads

  • You have to download the correct version of the driver for your Chrome Browser. Just check your browser version before download the file to this location "src\test\resources\drivers". After that you should fix the filename and extension on this file "src\test\java\base\DriverBase"

System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/chromedriver.exe");
config.properties file
  • Required fields: apiKey,googleKey,pageUrl
  • apikey is YOUR API KEY FROM 2captcha.com ->dashboard->Account Settings -> Copy API Key
  • googleKey is you should get it from target website(it will change for each application, you don't have to change it for this dummy project. But you should find it from the website code. More information:https://2captcha.com/2captcha-api#solving_recaptchav2_new)
  • pageUrl is the website which has recaptha on this test page. You should solve the invisible captcha on this demo just change the querystring which is at the and of the pageUrl invisible=false -> invisible=true
  • Optional fields: proxyIp, proxyPort, proxyUser, proxyPw
apiKey=YOUR_2captcha.com_API_KEY
googleKey=6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-
pageUrl=https://www.google.com/recaptcha/api2/demo?invisible=false
proxyIp=183.38.231.131
proxyPort=8888
proxyUser=username
proxyPw=password
Image Challenge Locally stored images

You should find the Recaptcha's iframe elements screenshots at this folder. This code is always taking screenshots and overwriting the existing 2 files automatically. "src\test\resources\screenshots"

  • imageFile.gif: That's the 3x3 or 4x4 image challenge box.
  • imageInstructions.gif: That's the instructions for 2captcha.com workers. Example: "Select all images with crosswalks"

alt text

How to run?

That's a junit-java-maven-selenium Webdriver project. Default Test folder is "src\test\java\tests\Recaptcha2Test.java" just right click on IntelliJ's project explorer window or run it from command line with maven command.

Warning:

I cannot guarantee that it will always work. However, I developed necessary implementations for possible scenarios. Response times from 2captcha.com should take between 30-90 seconds depending on your settings at 2captcha.com. https://2captcha.com/setting/percent_100

What is the motivation behind this project?

If it is possible to do this just showing it to the community to raise awareness.

What they can do? Bulk ticket purchases, limited number of product purchases, creating bot accounts,..

References:

https://github.com/2captcha/2captcha-api-examples

https://github.com/search?l=Java&q=2captcha&type=Repositories

https://2captcha.com/

google-recaptcha-solver-seleniumautomation's People

Contributors

ozgurkayaist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

google-recaptcha-solver-seleniumautomation's Issues

docker container

Hi,

Hope you are all well !

Is it possible to have this repository being dockerized with selenium ?
I cannot figure out how to do it.

Thanks in advance for any inputs or insights on this issue.

Cheers,
X

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.