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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:38:07+00:00 2026-06-10T09:38:07+00:00

I want to automatically grab some content from a page. I wonder if it

  • 0

I want to automatically grab some content from a page.

I wonder if it is possible:

  1. Run my own written JavaScript on the page after the page is loaded (I use FireFox. I don’t have the ability to change content of the page. I just want to run JS on my browser.). The script will use getelementbyid or similar method to get the link to the next page

  2. Run a JavaScript to collect my interested content (some URLs) on that page and store those URLs in a local file

  3. Go to next page (the next page will get really loaded with my browser, but I do not need to intervene at all) and repeat step 1 and step 2, until there is no next page.

The classic way to do this is to write a Perl script using LWP or PHP script using CURL, etc. But that is all server side. I wonder if I can do it client side.

  • 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-10T09:38:09+00:00Added an answer on June 10, 2026 at 9:38 am

    I do something rather similar, actually.

    By using GreaseMonkey, you can write a user-script that will interact with the pages however you need. You can get the next page link and scroll things as you like.

    You can also store any data locally, within Firefox though some new functions called GM_getValue and GM_setValue.

    I take the lazy way out. I just generate a long list of the URLs that I find when navigating the pages. I do a crude “document.write” method and I dump out my list of URLs as a batch file that rules on wget.

    At that point I copy-and-paste the batch file then run it.

    If you need to run this often enough that it should be automated, there used to be a way to turn GreaseMonkey scripts into Firefox extensions, that have access to more power.

    Another option is currently AFAIK, Chrome only. You can collect whatever information you need and build a large file from it, then use the download attribute of a link and come up with a single-click to save things.

    Update

    I was going to share the full code for that I was doing, but it was so tied to a particular website that it wouldn’t have really helped — so I’ll go for a more “general” solution.

    Warning, this code typed on the fly and may not be actually correct.

    // Define the container
    // If you are crawling multiple pages, you'd want to load this from
    // localStorage.
    var savedLinks = [];
    
    // Walk through the document and build the links.
    for (var i = 0; i < document.links.length; i++) {
      var link = document.links[i];
    
      var data = { 
        url: link.url,
        desc = getText(link)
      };
    
      savedLinks.push(data);
    }
    
    // Here you'd want to save your data via localStorage.
    
    
    // If not on the last page, find the 'next' button and load the next page
    // [load next page here]
    
    // If we *are* on the last page, use document.write to output our list.
    // 
    // Note: document.write totally destroys the current document.  It really is quite
    // an ugly way to do it, but in this case it works.
    document.write(JSON.stringify(savedLinks, null, 2));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to grab some elements of a page using jQuery and ajax...no problem.
I want to automatically fit listview content according to the screen size i.e If
I want to automatically run a class method defined in a base class on
i want to automatically run a simple shell script at linux startup i'm working
I get poorly formatted invoice-related email from my payment gateway. I want to automatically
I want to automatically add routes from my bundle without adding a link to
I'm writing some unit test in my web apps and I want to automatically
I want to automatically extract data from tables of a Word document. I do
I want to automatically answer questions with Greasemonkey. I have the questions and answers,
I want to automatically fit time series returns into a NIG distribution. With nigfit()

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.