Join And Get Free Trial!

2024 में वेब स्क्रैपिंग करते समय रिकैप्चा सॉल्वर के साथ रिकैप्चा को कैसे हल करें#

logoNextCaptcha
May 20,2024

reCAPTCHA अवलोकन#

reCAPTCHA Google द्वारा प्रदान की जाने वाली एक निःशुल्क सेवा है जो वेबसाइटों को स्पैम और दुरुपयोग से बचाने में मदद करती है। यह मनुष्यों को बॉट्स से अलग करने के लिए उन्नत जोखिम विश्लेषण तकनीकों और अनुकूली चुनौतियों का उपयोग करता है। "CAPTCHA" शब्द का अर्थ है "कंप्यूटर और मनुष्यों को अलग बताने के लिए पूरी तरह से स्वचालित सार्वजनिक ट्यूरिंग परीक्षण।" पिछले कुछ वर्षों में reCAPTCHA के कई संस्करण आ चुके हैं:
  • reCAPTCHA v1: यह मूल संस्करण था जो उपयोगकर्ताओं को विकृत पाठ प्रदान करता था जिसे उन्हें समझना था और एक बॉक्स में दर्ज करना था। यह पुस्तकों और अन्य मुद्रित सामग्रियों को डिजिटल बनाने के लिए उपयोगी था, लेकिन मनुष्यों के लिए इसे हल करना अक्सर मुश्किल होता था।

    • nextcaptcha recaptcha-badge

  • reCAPTCHA v2: इस संस्करण में "मैं रोबोट नहीं हूँ" चेकबॉक्स पेश किया गया है, जिस पर उपयोगकर्ताओं को क्लिक करने के लिए कहा जाता है। यदि सिस्टम को यह सुनिश्चित नहीं है कि उपयोगकर्ता मानव है या नहीं, तो यह अतिरिक्त चुनौतियाँ पेश करेगा, जैसे कि छवियों में वस्तुओं की पहचान करना।

    • nextcaptcha RecaptchaLogo

  • reCAPTCHA v3: यह संस्करण पृष्ठभूमि में चलता है और चुनौतियों के साथ उपयोगकर्ताओं को बाधित नहीं करता है। इसके बजाय, यह वेबसाइट के साथ उनकी बातचीत के आधार पर प्रत्येक आगंतुक को एक जोखिम स्कोर प्रदान करता है। वेबसाइट के मालिक तब इस स्कोर का उपयोग यह तय करने के लिए कर सकते हैं कि आगंतुक को कैसे संभालना है (उदाहरण के लिए, ब्लॉक करना, चुनौती पेश करना, आदि)।

    • nextcaptcha solve-recaptcha-enterprise

reCAPTCHA हल करना#

आवश्यक शर्तें#

  • लाइब्रेरी का अनुरोध करें
    • हम उदाहरण कोड के लिए पायथन अनुरोध का उपयोग करते हैं
  • अगलाकैप्चा क्लाइंट कुंजी

डैशबोर्ड से NextCaptcha क्लाइंट कुंजी प्राप्त करें#

अपनी निःशुल्क API कुंजी और निःशुल्क परीक्षण क्रेडिट तुरंत प्राप्त करने के लिए NextCaptcha पर साइन अप करें।

reCAPTCHA हल करने के लिए पायथन कोड#

# create task
    """
        Create NextCaptcha CAPTCHA solver task.
 
        :param task: task of captcha dict.
        :param client_key: the client key form nextcaptcha dashboard.
        :param solft_id: Optional. The value of the 'solft_id'.
        :param callback_url: Optional. callback when the captcha task finish.
        :return: A dictionary containing the solution of the reCAPTCHA.
      """
    def send_task(task, client_key, solft_id, callback_url):
        HOST = "https://api.nextcaptcha.com"
        session = requests.session()
        data = {
            "clientKey": client_key,
            "solftId": solft_id,
            "callbackUrl": callback_url,
            "task": task,
        }
        resp = session.post(url=HOST + "/createTask", json=data)
        if resp.status_code != 200:
            return resp.json()
        resp = resp.json()
        task_id = resp.get("taskId")
 
        start_time = time.time()
        while True:
            if time.time() - start_time > TIMEOUT:
                return {"errorId": 12, "errorDescription": "Timeout", "status": "failed"}
 
            resp = session.post(url=HOST + "/getTaskResult",
                                     json={"clientKey": client_key, "taskId": task_id})
            if resp.status_code != 200:
                return resp.json()
            status = resp.json().get("status")
            if status == READY_STATUS:
                return resp.json()
            if status == FAILED_STATUS:
                return resp.json()
            time.sleep(1)
 

reCAPTCHA v2 को हल करने के लिए पायथन उदाहरण कोड#

  def recaptchav2(self, website_url: str, website_key: str, recaptcha_data_s_value: str = "",
                    is_invisible: bool = False, api_domain: str = "", page_action: str = "") -> dict:
        """
        Solve reCAPTCHA v2 challenge.
 
        :param website_url: The URL of the website where the reCAPTCHA is located.
        :param website_key: The sitekey of the reCAPTCHA.
        :param recaptcha_data_s_value: Optional. The value of the 'data-s' parameter if present.
        :param is_invisible: Optional. Whether the reCAPTCHA is invisible or not.
        :param api_domain: Optional. The domain of the reCAPTCHA API if different from the default.
        :return: A dictionary containing the solution of the reCAPTCHA.
        """
        task = {
            "type": "RecaptchaV2TaskProxyless",
            "websiteURL": website_url,
            "websiteKey": website_key,
            "recaptchaDataSValue": recaptcha_data_s_value,
            "isInvisible": is_invisible,
            "apiDomain": api_domain,
            "pageAction": page_action,
        }
        return send_task(task)

reCAPTCHA v2 एंटरप्राइज़ को हल करने के लिए पायथन उदाहरण कोड#

 
    def recaptchav2enterprise(self, website_url: str, website_key: str, enterprise_payload: dict = {},
                              is_invisible: bool = False, api_domain: str = "", page_action: str = "") -> dict:
        """
        Solve reCAPTCHA v2 Enterprise challenge.
 
        :param website_url: The URL of the website where the reCAPTCHA is located.
        :param website_key: The sitekey of the reCAPTCHA.
        :param enterprise_payload: Optional. Additional enterprise payload parameters.
        :param is_invisible: Optional. Whether the reCAPTCHA is invisible or not.
        :param api_domain: Optional. The domain of the reCAPTCHA API if different from the default.
        :return: A dictionary containing the solution of the reCAPTCHA.
        """
        task = {
            "type": "RecaptchaV2EnterpriseTaskProxyless",
            "websiteURL": website_url,
            "websiteKey": website_key,
            "enterprisePayload": enterprise_payload,
            "isInvisible": is_invisible,
            "apiDomain": api_domain,
            "pageAction": page_action,
        }
        return send_task(task)

reCAPTCHA v3 को हल करने के लिए पायथन उदाहरण कोड#

    def recaptchav3(self, website_url: str, website_key: str, page_action: str = "", api_domain: str = "",
                    proxy_type: str = "", proxy_address: str = "", proxy_port: int = 0, proxy_login: str = "",
                    proxy_password: str = "") -> dict:
        """
        Solve reCAPTCHA v3 challenge.
 
        :param website_url: The URL of the website where the reCAPTCHA is located.
        :param website_key: The sitekey of the reCAPTCHA.
        :param page_action: Optional. The action parameter to use for the reCAPTCHA.
        :param api_domain: Optional. The domain of the reCAPTCHA API if different from the default.
        :param proxy_type: Optional. The type of the proxy (HTTP, HTTPS, SOCKS4, SOCKS5).
        :param proxy_address: Optional. The address of the proxy.
        :param proxy_port: Optional. The port of the proxy.
        :param proxy_login: Optional. The login for the proxy.
        :param proxy_password: Optional. The password for the proxy.
        :return: A dictionary containing the solution of the reCAPTCHA.
        """
        task = {
            "type": "RecaptchaV3TaskProxyless",
            "websiteURL": website_url,
            "websiteKey": website_key,
            "pageAction": page_action,
            "apiDomain": api_domain,
        }
        if proxy_address:
            task["type"] = "RecaptchaV3Task"
            task["proxyType"] = proxy_type
            task["proxyAddress"] = proxy_address
            task["proxyPort"] = proxy_port
            task["proxyLogin"] = proxy_login
            task["proxyPassword"] = proxy_password
        return send_task(task)
 

reCAPTCHA मोबाइल को हल करने के लिए पायथन उदाहरण कोड#

 
    def recaptcha_mobile(self, app_key: str, app_package_name: str = "", app_action: str = "") -> dict:
        """
        Solve Mobile reCAPTCHA challenge.
 
        :param app_key: The app key of the Mobile reCAPTCHA.
        :param app_package_name: Optional. The package name of the mobile app.
        :param app_action: Optional. The action parameter to use for the Mobile reCAPTCHA.
        :return: A dictionary containing the solution of the Mobile reCAPTCHA.
        """
        task = {
            "type": "RecaptchaMobileProxyless",
            "appKey": app_key,
            "appPackageName": app_package_name,
            "appAction": app_action,
        }
        return send_task(task)
 

निष्कर्ष#

NextCaptcha उच्च रखरखाव, अद्यतित और सबसे सस्ती ReCaptcha मोबाइल सॉल्वर सेवा, स्थिर 24/7 समर्थन
सफल डेटा पुनर्प्राप्ति के लिए, आपको CAPTCHA को संभालने के लिए पूरी तरह से भरोसा करने के लिए एक शक्तिशाली उपकरण की आवश्यकता होती है। NextCaptcha एक आसान-से-सेटअप API प्रदान करता है जो आपको सभी एंटी-बॉट चुनौतियों को दूर करने में सक्षम बनाता है, और आप इसे आज ही मुफ़्त में आज़मा सकते हैं।

अधिक#