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 8817831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:56:51+00:00 2026-06-14T04:56:51+00:00

I need to fetch a list items available in a website that list the

  • 0

I need to fetch a list items available in a website that list the items in paging style. I will extract information of the items on each pages. I wrote a Javascript code using a settimeout(function(){...code...}, 5000), and run this code in the Firefox web console. The script fetches all the items in the page, once this is done, the script submits the page by executing click() method of the hyperlink "next". this will continue till the page has "Next" hyperlink in the page (in last page only "back" hyperlink if present). On every page submit I timeout it to 5 seconds.

I executed this code in the Firefox web console, this run successfully and fetches the first pages results, then submits the page, the next page too loads. But, the problem is, once the page is submitted the script stops. How to run this script continuously even after the next page load? Is there any other way to achieve this functionality?

var inc=0;
var ids;
var main=function(){
console.log("attempiting..............."+inc);
var i=0;
{
    ids[inc]=b();//function, fetch the items from the page
    console.log(ids);
    var more=document.getElementById("m_more_item");
    if(more){
        //next link is there
        var cli=more.getElementsByTagName("a");
        console.log("navigating to next page "+cli[0]);
        inc++;
        setTimeout(main,5000); //I tried placing this after click, but didnt work!
        cli[0].click(); //submitting...
    } else {
        //last page reached, exiting...
        console.log("exit1-> total items fetched are: "+ids);
        return ids;
    }
}
};
main();
  • 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-06-14T04:56:53+00:00Added an answer on June 14, 2026 at 4:56 am

    setTimeout call make you function recursive and keep looping this should work.

    setTimeout(cli[0].click, 5000);
    

    Cheers.

    EDIT:
    It was long for a comment so I am adding it as a answer.

    You can use AJAX calls in separated page first call the page with AJAX with start=1 and on success of this request parse the data and collect information as you need and do not forget the keep lastItemIndex for your next request and post the information you need with another AJAX call on success of the second AJAX call first one with start=lastItemIndex+1.

    These calls should do what you want.

    I suggest using jQuery for this as it will be easy to call AJAX and parse the response.

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

Sidebar

Related Questions

I have list of DateTime values, and for each value I need to fetch
I need a form that inludes a list of related available options that can
In my viewmodel, I have a list of items I fetch from the database
I need an advice. I am creating an android application that have multiple List
I need to be able to bring up a list of items from the
Say I have 10N items(I need to fetch them via http protocol), in the
I have two tables each with a field we will call widgetid. I need
I have an application where I need to take the items from a list
I am having a List View, all the list items(Text) need be to updated
I have a PHP generated form which consists of a list of items, each

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.