Reputation: 2599
I want to create a script that retrieves the HTML from several pages on a website and parse that DOM content to extract data I want.
The reason I want to do this with JavaScript is that I want to use JQuery's sizzle engine to easily parse the DOM to retrieve the information.
However with the Cross-domain policies most browsers have, I haven't found a solution yet. I stumbled across JSONP, but since that site doesn't explicitly support it, I can't use that approach.
I also thought about using IFRAMES, but Jquery doesn't seem to be able to retrieve the content either...
So my question really comes down to : Is there a way to get the DOM of a remote web page using javascript/ajax/jquery? Are there libraries that allow this?
Upvotes: 4
Views: 2256
Reputation: 35572
No there is no way of read data from cross domains through client script Unless they allow it.
You should be looking for a solution to read the the data on the server side and then you may use it on the client side as you want.
Upvotes: 2