Skip to content Skip to sidebar Skip to footer

I Need To Extract Somehow (probably Using Javascript) Some Information In My Clients' Websites. What's The Best Way To Do It?

I want to plug my clients' websites to a system that I have. I need to be able to use some information that is in the website in order to improve the user experience in my system (

Solution 1:

I'm not sure if your 'system' is a web tool or desktop based program, but if it is a web tool dynamic drive have a nice piece of javascript that can achieve the results you want without needing to modify the clients site:

Dynamic Ajax Content

Now I'm guessing you may want to change the content around your self and not display it exactly as it is on your clients site. So heres a quick modification of their script function loadpage() so that you can catch the html in a variable (loadedContent):

var loadedContent;

    functionloadpage(page_request, containerid){
         if (page_request.readyState == 4 && (page_request.status==200 ||  window.location.href.indexOf("http")==-1))
         loadedContent = page_request.responseText
    }

Now if you follow the instructions on their page to setup and call the script ... after its execution you will have the html of the page stored in loadedContent for you to play about with.

if you want to test it working before you implement it, go to the link above, open your developer console, put the moded code in and hit enter. This should replace their function on the fly. Now see their demo at the top, click on one of the different pages. Nothing visible should happen. Go to your console and now type in loadedContent. You should see the html they where trying to load stored there.

Hope this helps

Post a Comment for "I Need To Extract Somehow (probably Using Javascript) Some Information In My Clients' Websites. What's The Best Way To Do It?"