0

Here I have a some HTML code and I need to 1st. load url source code then type xpath and as a result get a some text from that URL based on xPath... How to do that... with jquery, ajax ... ???

http://jsfiddle.net/cHtWq/

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<label>Enter URL address here: 
<input name="textfield" type="text" value="http://www." />
</label>
<label>
<input type="submit" name="Submit" value="Submit" />
<br />
<br />
Enter xpath location of element:
<input type="text" name="textfield2" />
<input type="submit" name="Submit2" value="Submit" />
<br />
<br />
Selected element is: </label>
<p>&nbsp;</p>
</body>
</html>
2
  • something like xpath extractor ... Commented Feb 15, 2012 at 17:16
  • Yes I can becouse I first load source code from some URL... Commented Feb 15, 2012 at 17:20

1 Answer 1

1

You cannot do this in JavaScript because of the Same Origin Policy you will need some back end scripting to do this.

Sign up to request clarification or add additional context in comments.

10 Comments

I think it can be possiblle with ajax
1st load source code when I type URL and click on submit then I write a xpath location and as a result get a text
@MikiCloud AJAX isn't magic ... it has to adhere to the the same security policy ... you can do cross domain AJAX but using JSONP only ...
Ok how I can do that with JSON?
please Help and I will appreciate to donate some money on your paypal account HELP!
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.