JavaScript generate an result array from XPATH

This is a function in JavaScript that use an XPATH string to generate an Array from the results.This is very useful if you have to manipulate or use some items on a page and don’t have the id(like bots).

That is the function:

You could use it in the Terminal:

And we get all hrefs on this page in the Terminal:

Use it to store it in an Array and then write it on the page:

and we got this result:

10 thoughts on “JavaScript generate an result array from XPATH”

  1. Remarkable issues here. I am very happy to see your article.
    Thanks a lot and I am looking ahead to contact you.

    Will you please drop me a e-mail?

  2. This post offers clear idea designed for the new visitors of blogging, that genuinely how to do blogging.

  3. What’s up to every one, the contents present at this website are genuinely remarkable for people experience, well, keep up the good work fellows.

  4. Hey! I know this is kind of off topic but I
    was wondering which blog platform are you using for this site?
    I’m getting tired of WordPress because I’ve had issues with hackers and I’m looking at alternatives for another
    platform. I would be great if you could point me in the
    direction of a good platform.

  5. I do consider all of the concepts you have introduced for your post.
    They’re really convincing and can definitely work.
    Nonetheless, the posts are too quick for starters. May you please prolong
    them a little from next time? Thank you for the post.

  6. Ahaa, its fastidious discussion concerning this paragraph at this place at this weblog, I have read all that, so at this time me also commenting here.

  7. I do trust all the ideas you’ve presented for your post.
    They are really convincing and will certainly work.

    Nonetheless, the posts are too short for newbies. May just you please extend
    them a little from next time? Thank you for the post.

  8. Your style is unique compared to other people I have read
    stuff from. I appreciate you for posting when you have the opportunity, Guess I will just bookmark this site.

  9. Heya i’m for the first time here. I found this board and I to find It truly
    useful & it helped me out much. I’m hoping to provide
    one thing again and aid others such as you helped me.

Leave a Reply

Your email address will not be published.

6 − six =