All Downloads are FREE. Search and download functionalities are using the official Maven repository.

examples.GridOptionsExample Maven / Gradle / Ivy

Go to download

Java library for easy integration with the API of 2captcha captcha solving service to bypass recaptcha, hcaptcha, funcaptcha, geetest and solve any other captchas.

There is a newer version: 1.1.2
Show newest version
package examples;

import com.twocaptcha.TwoCaptcha;
import java.io.File;
import com.twocaptcha.captcha.Grid;

public class GridOptionsExample {

    public static void main(String[] args) {
        TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");

        Grid captcha = new Grid();
        captcha.setFile("src/main/resources/grid_2.jpg");
        captcha.setRows(3);
        captcha.setCols(3);
        captcha.setPreviousId(0);
        captcha.setCanSkip(false);
        captcha.setLang("en");
        captcha.setHintImg(new File("src/main/resources/grid_hint.jpg"));
        captcha.setHintText("Select all images with an Orange");

        try {
            solver.solve(captcha);
            System.out.println("Captcha solved: " + captcha.getCode());
        } catch (Exception e) {
            System.out.println("Error occurred: " + e.getMessage());
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy