I am having problems with my types and would be really glad if you could help me. I am downloading a captcha using
captcha = self.chrome_driver.driver.find_element_by_xpath(captcha_xpath).screenshot_as_png
which according the documentation: saves the screenshot of the current element as a binary data.
Then i want to send it to twocaptcha function normal(captcha, caseSensitive=True)
which according to the documentation takes image or base64. So when i run the function i get error
TypeError: a bytes-like object is required, not 'str The type of captcha is <class 'bytes'>
How to convert the captcha to base64 or image in order to make it work.