I'm really new to Javascript/jQuery. I've coded in Objective-C and Swift before and there it was possible to parse a (x)html-website with XPath and a framework like Hpple.
Now I have to do something like that in JavaScript(Cloud Code from parse.com).
My problem is now, that I'd like to parse like that:
var url = "http://www.google.com";
var xpath = "//body";
someJavaScriptMagic.parse(url, xpath);
I've often seen people using the document.evaluate
method, but there they parsed the website on which they were at the moment and not another website.
Is there a way to do that?
I dont know if it's important, but I'm using CloudCode from parse.com
EDIT:
I've already tried using the ajax-query:
$.ajax({ url: 'http://www.digitec.ch', success: function(data) { alert(data); } });
But I get the following error each time:
XMLHttpRequest cannot load http://www.digitec.ch/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://fiddle.jshell.net' is therefore not allowed access.