daily pastebin goal
0%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <div>
  2.   <div>Everyday People</div>
  3.   <div>My name is ACE</div>
  4.   <div>Hello world</div>
  5. </div>
  6.    
  7. <script type="text/javascript" src="js/jquery/js/jquery-1.3.2.min.js"></script>
  8. <script type="text/javascript" src="js/jquery/js/xpath-selector.js"></script>
  9.  
  10. <script type="text/javascript">
  11. function get_XPath(elt)
  12. {
  13.   var path = '';
  14.   for (; elt && elt.nodeType == 1; elt = elt.parentNode)
  15.   {
  16.     var idx = $(elt.parentNode).children(elt.tagName).index(elt) + 1;
  17.     idx > 1 ? (idx='[' + idx + ']') : (idx='');
  18.     path = '/' + elt.tagName.toLowerCase() + idx + path;
  19.   }
  20.   return path;
  21. }
  22.  
  23. var arr = Array();
  24. htmlDoc = document;
  25. x = htmlDoc.documentElement.childNodes;
  26.  
  27. for (i=0; i<x.length; i++)
  28. {
  29.   arr.push(get_XPath(x[i]));  
  30. }
  31. </script>
  32.    
  33. <script>
  34. for(i=0;i<arr.length;i++)
  35. {
  36.   //catch the object reference with the XPath info
  37.   $(arr[i])
  38.  
  39. }
  40. </script>
  41.    
  42. $(arr[i]).text();
  43.    
  44. var arr = new Array();
  45. htmlDoc = document;
  46. x = htmlDoc.documentElement.childNodes;
  47.  
  48. for (i=0,b=x.length; i<b; i++){
  49.   arr.push($(x[i]));  
  50. }
  51.    
  52. arr[i].text();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top