Answer the question
In order to leave comments, you need to log in
How to read captcha from a link?
There is a service for solving captchas, rucaptcha, I use it to solve simple pictures, the method works fine if you specify the path to the picture on the computer. You can somehow implement solving by link to the picture without downloading it to your PC. Here is the code:
import sys
import os
import twocaptcha
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
api_key = os.getenv('APIKEY_2CAPTCHA', 'API')
solver = twocaptcha.TwoCaptcha(api_key)
url = 'https://www.impex-jp.com/zip/part-search/check.html?v=60c7c9a0c71a0'
try:
result = solver.normal(url)
print(result)
except Exception as e:
sys.exit(e)
else:
sys.exit('solved: ' + str(result))
Answer the question
In order to leave comments, you need to log in
You download the image through some kind of requests, encode it in base64, and paste it. In your example, something like:
import sys
import os
import twocaptcha
import base64
import requests
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
def get_as_base64(url):
return base64.b64encode(requests.get(url).content).decode('utf-8')
api_key = os.getenv('APIKEY_2CAPTCHA', 'API')
solver = twocaptcha.TwoCaptcha(api_key)
url = 'https://www.impex-jp.com/zip/part-search/check.html?v=60c7c9a0c71a0'
try:
result = solver.normal(get_as_base64(url))
print(result)
except Exception as e:
sys.exit(e)
else:
sys.exit('solved: ' + str(result))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question