From 5d94fda82aee89c41c5879f786930565493b329c Mon Sep 17 00:00:00 2001 From: Andrei Date: Fri, 1 Mar 2019 20:29:28 +0300 Subject: [PATCH] Add nocaptcha contexmanager example --- anticaptcha_examples/anticaptcha_nocaptcha_example.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/anticaptcha_examples/anticaptcha_nocaptcha_example.py b/anticaptcha_examples/anticaptcha_nocaptcha_example.py index bfb57aa..7af591f 100644 --- a/anticaptcha_examples/anticaptcha_nocaptcha_example.py +++ b/anticaptcha_examples/anticaptcha_nocaptcha_example.py @@ -12,6 +12,15 @@ result = NoCaptchaTaskProxyless.NoCaptchaTaskProxyless(anticaptcha_key = ANTICAP websiteKey='6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-') print(result) +# contextmanager +with NoCaptchaTaskProxyless.NoCaptchaTaskProxyless(anticaptcha_key = ANTICAPTCHA_KEY) as nocaptcha: + response = nocaptcha.captcha_handler( + websiteURL='https://www.google.com/recaptcha/api2/demo', + websiteKey='6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-' + ) +print(response) + + # Пример работы антикапчи с гугловской невидимой рекапчёй и обычной рекапчёй с использованием ПРОКСИ result = NoCaptchaTask.NoCaptchaTask(anticaptcha_key = ANTICAPTCHA_KEY, proxyType='http',