import pyautogui
import selenium
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
Hello! So I have been able to detect in Selenium Solving is in process... http://prntscr.com/pib0pf and than if the Element is Active, a time.sleep() will be activated before the rest of the code continues. To give Captcha some time before it is solved. But the thing is that I changed my mind and thought it would be actually better if I found a way to make selenium check for the element and if the element is not yet available, a time.sleep() should be executed. I want this because the first idea will run into errors if the captcha is not solved in the given time. But with the second idea, Selenium will automatically check if the given Element is active, and if not, a 30 seconds should be added to the script before the rest of the code executes.
#~ Continuing code
time.sleep(3)
print("Form filled!")
time.sleep(10)
if driver.find_element_by_xpath("//div[@class='antigate_solver recaptcha in_process']"):
print("Waiting 60 seconds...\n")
time.sleep(60)
if driver.find_element_by_xpath("//div[@class='antigate_solver recaptcha solved']"):
time.sleep(1.5)
print("Captcha Solved...")
driver.find_element_by_xpath('/html[1]/body[1]/main[1]/div[1]/div[2]/form[1]/small[1]/div[1]/label[1]/input[1]').click()
print("Submitting...")
time.sleep(1.5)
driver.find_element_by_xpath('/html[1]/body[1]/main[1]/div[1]/div[2]/form[1]/div[12]/button[1]').click()