Jump to content

xmlhttp request object to xmldom object


mugs

Recommended Posts

hello!

i m currently workin on a project in my college which involves reading data from a normal internet web page.. my question is how can i do it??

i hv tried using using xmlhttp request obj bt it jst works wen i send a request to a webpage stored locally on my machine n nt over the internet.. also i wish to extract the data within the responseText tht i get.. in the sense tht i want to get the data within the various tags, eg i m nt interested whether there is <table> or a <div> or a <p> tag, i jst want whatever is written in it.. this can be done using the xmldom.getElementsByTagName option i think, bt the prob is hw do i convert the responseText to a xmldom object..

 

please help..

Link to comment
Share on other sites

AJAX only allows you to make requests to the same domain (for security reasons). to access external html, you need to run it through a local script:

-http://host1.com/index.php uses ajax to call http://host1.com/external.php

-http://host1.com/external.php uses php and curl or fopen to access http://host2.com/page.php

-http://host1.com/external.php returns the contents from the previous step

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.