I think you mean "using Xpath" rather than "getting Xpan", so I hope you don't mind that I have revised your topic title to better reflect the question you have asked.
FROM: Get xpath with Java Script
TO: Need Help Using Xpath in a JavaScript
This will greatly help you attract more experienced users to help solve your problem, and will help future readers find your question, and the solution.
Xpaths are hard to use and work with. I much prefer using the JavaScript querySelector.
Please provide the URL of the target page, along with a screenshot highlighting the text you want, along with the resultant text you want. Then we can offer you much better help.