Closed MacMarde closed 4 years ago
I have found a solution. Thanks to help in the chat on gitter @sameroom It is something like:
from io import BytesIO
import base64
ele_captcha = browser.find_element_by_id('captchaImg')
fp = BytesIO(base64.b64decode(ele_captcha.screenshot_as_base64))
client = AnticaptchaClient(api_key)
task = ImageToTextTask(fp)
job = client.createTask(task)
job.join()
return job.get_captcha_text()
I am using selenium with python and want to solve a text captcha The captcha can NOT be read from the URL with something like:
It is not working because I get a different captcha from the one I see on the website.
So I do need to find a way to read the captcha image from the website directly.
I can get the captcha image and read the base64 image data with:
Is there a way to use this base64 data with python-anticaptcha ImageToTextTask?
I am still trying. I would appreciate any help.