Hello, I need to get the base64 from a captcha image to pass it to a method that solves it. The thing is, how do I manage to do that?
This my view but the code with the screenshot variable is the part that does not work:
DRIVER_PATH = 'C:/Users/python/chromedriver.exe' driver = webdriver.Chrome(executable_path=DRIVER_PATH) driver.get('https://seti.afip.gob.ar/padron-puc-constancia-internet/ConsultaConstanciaAction.do') driver.switch_to.frame(driver.find_element_by_tag_name("iframe")) wait = WebDriverWait(driver, 30) elem = wait.until(EC.presence_of_element_located((By.XPATH,"//input[@id='cuit']"))) elem.send_keys(cuit_r) elem2= wait.until(EC.presence_of_element_located((By.XPATH,"//input[@id='CaptchaCode']"))) screenshot = driver.get_screenshot_as_base64() resolve_simple_captcha(screenshot) elem4 = wait.until(EC.element_to_be_clickable((By.XPATH, '//div[@id="btnConsultar"]'))) elem4.click()
Basically I have to pass the base64 image to my resolve_simple_captcha method in order to get it solved. How do I do that? This is how the method works: