Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I install browser plugins like 2Captcha to solve captchas? #73

Open
willowypanda opened this issue Jul 26, 2024 · 1 comment
Open

Comments

@willowypanda
Copy link

If so, how can I do it in PulsarRPA? Thanks!

@platonai
Copy link
Owner

platonai commented Aug 1, 2024

Sure! You can add an event handler to check and resolve captchas:

Here is a simple demo:

    fun options(args: String): LoadOptions {
        val options = session.options(args)

        val be = options.event.browseEventHandlers

        be.onDocumentActuallyReady.addLast { page, driver ->
            // Check if the page shows captchas here
            // If the captcha appears, call 2Captcha
        }

        return options
    }

    val url = "https://www.amazon.com/dp/B0C1H26C46"
    val args = "-refresh"
    session.load(url, options(args))

source code:
https://github.com/platonai/PulsarRPA/blob/4900e8911c6d500cd3bf8d4512e7c3a689894caf/pulsar-app/pulsar-examples/src/main/kotlin/ai/platon/pulsar/examples/_7_RPA.kt

For all available event handlers, see:

https://github.com/platonai/PulsarRPA/blob/4900e8911c6d500cd3bf8d4512e7c3a689894caf/pulsar-app/pulsar-examples/src/main/kotlin/ai/platon/pulsar/examples/_6_EventHandler.kt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants