I am using services of ImageTyperz for solving the captcha but unable to submit a response back to the website. There is no submit button but a callback is there which should be called. When i call this callback i get selenium.common.exceptions.TimeoutException: Message: script timeout exception. The function which is called looks like this
function solvedCaptcha(payload) {
const timeoutMs = 10000;
protectionSubmitCaptcha("recaptcha", payload, timeoutMs, "3:wi5qRb7c93CuT63y1uUslQ==:BXJXyJOzlEFA5FdRRQw7hUgzO5M4FIz8DegFPzs6fER0MRWYM+P2Vac+z3qKo5UxmDqMuThgGaT0hK+Tu6Zj0b5sprMSQI7P2Wv7fAj7aFUC20NO7VN6NtyyTehmQcxscyQBUqvlXbyTct2rUi81hPRk9fp7Vt32kGZspgx0v4tbTmDK2xMG1mj5nOVN9TL5zs88iYQDfSa2lKcdLrhYl5VcEDh5rAAte8d6rvead+5oY0a8B7fennPu2+36wZboyg4JJ1yMSpMmZ8Nk47/R/Q==:BwSP9POMwcERVjmiYuOpMZkDQmQS1ksQSij5jk8Fs8A=").then(function() {
window.location.reload(true);
});
}
I am running the following command
driver.execute_async_script("var payload = " + str(recaptcha_response) + ";" + "solvedCaptcha(payload);")
Here recaptcha_response is the response dict got from ImageTyperz api.
execute_scripthere. Otherwise it times out waiting for a callback.