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

  • Home
  • SEARCH
  • 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 6667885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:58:50+00:00 2026-05-26T02:58:50+00:00

Problem Overview I have a dynamically produced web page, X , which consists of

  • 0

Problem Overview

  • I have a dynamically produced web page, X, which consists of search results linking to web pages, Y1, Y2, Y3 etc.
  • Y1 contains a resource URL R1, Y2 contains resource URL R2, and so on.
  • I would like to dynamically enhance page X with links to resources R1, R2 etc.

Possible Solution

I’m currently thinking of using JavaScript and XMLHTTPRequest to retrieve the HTML from web pages Y1, Y2, etc., and to then use a regular expression to extract the URL.

Pages Y1, Y2, etc. are in the region of 30-100KB HTML each.

Does this sound like a good plan? Or would I be better retrieving each web page in JSON format and extracting the resource URL from there? If HTML is the way to go, do you have any suggested optimisations/short cuts for searching 30-100 KB of text?

  • 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-26T02:58:50+00:00Added an answer on May 26, 2026 at 2:58 am

    You don’t want to use regex to extract the URL. I suggest using jQuery to perform the AJAX request, and then use jQuery to parse and filter out the URLs from the HTML that is returned from the server.

    jQuery.ajax({
        url: "http://my.url.here",
        dataType: "html";
        ...
        success: function(data) {
            jQuery("a", data).each(function() {
                var $link = jQuery(this);
                ...
                ...
            });
        }
        ...
    });
    

    If jQuery is not an option, you can do something like this when you get your response back:

    var html = XHR.responseText;
    var div = document.createElement("div");
    div.innerHTML = html;
    
    //you can now search for nodes inside your div.
    //The following gives you all the anchor tags
    div.getElementsByTagName('a'); 
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem I have timestamped data, which I need to search based on the timestamp
General Overview Hi all, I have 4 spans in which values are inputted dynamically
Problem: I have an address field from an Access database which has been converted
Problem: We have a web app that calls some web services asynchronously (from the
I have a problem which I can't seem to be figuring out: I load
Problem overview: When using Eclipse Ganymede with the Web Tools Platform the project gets
On my website's Start page I have a Search Mask where user set select
Here's an overview of my problem: I have a templated class called TWMatrix. I've
I have a problem that i want to search in the specific locations in
Problem: I have two spreadsheets that each serve different purposes but contain one particular

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.