Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6320353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:57:23+00:00 2026-05-24T15:57:23+00:00

This jQuery calls a script that scrapes a page and returns a json array

  • 0

This jQuery calls a script that scrapes a page and returns a json array back to the jQuery. However, in certain cases, the cURL script results in a redirect to a captcha challenge page (see the cURL in the class script).

Once I’ve determined that the cURL page is a captcha (rather than the intended page), how can I redirect the captcha to the user?

Should I just extract the captcha image and the form’s action parameters and hidden fields and recreate the form to allow the user to submit it?

jQuery('#myDiv a').click
    (
        function()
        {       
            jQuery('#loader').show();

            var result='';

            jQuery.ajax
            ({
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                url: getPage.php,
                success: function(data)
                {       
                    if(data['captcha'])
                    {
                        //need to load the captcha page for the user to complete
                        return;
                    }
                }
            });
        });


//Contents of getPage.php

    class loadPageCurl {

        function loadPage($url, $headonly = TRUE ){

        $agents = 'Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16';

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_VERBOSE, FALSE);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
        curl_setopt($ch, CURLOPT_USERAGENT, $agents);
        curl_setopt($ch, CURLOPT_URL, $url);

        $curlResp = curl_exec($ch);
        curl_close($ch);

        //check to see if captcha or regular page and process accordingly
        if(//page is captcha)
        {
            //Redirect the html stream to the user for captcha completion
        }
        else
        {
        return $curlResp;
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T15:57:24+00:00Added an answer on May 24, 2026 at 3:57 pm

    http://api.jquery.com/jQuery.get/ must help.

    $.get('ajax/test.html', function(data) {
        $('.result').html(data);
        alert('Load was performed.');
    });
    

    Can load contents from the file and put it into a div or something like that.

        if(//page is captcha)
        {
                $.get('captcha.html', function(data) {
                    $('.captchaDiv').html(data);
                });
        }
    

    This may solve your problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script that calls a php page via jquery/ajax. The results would
So I have this JQuery template that calls a function: <script id=Fred type=text/x-jQuery-tmpl> <td>${functionX()}${Field2}</td>
This is my first time attempting to call an ASP.NET page method from jQuery.
i'have a js client with JQuery, this js call a page (GET HTTP) and
I have this jQuery code that queries an API on a keyup event (via
I have this code in jQuery, that I want to reimplement with the prototype
I have this jquery script which suppose to hide/show div element base on the
I'm currently working on a jQuery script that will translate the site's text into
We have an application with a good amount of jQuery JSON calls to server
Hello I have a script that uploads multiple images (this script is composed of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.