Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

XPATH: Finding text inside the selector

  • 15-05-2017 08:11PM
    #1
    Registered Users, Registered Users 2 Posts: 5,767 ✭✭✭


    Below xpath up to the word overview is found fine in the document
    .//*[@class='report-container' and not(contains(@style,     "none"))]/descendant::*[contains(@class, 'table-patient-report-overview')]/descendant::table/tbody /tr[ td[descendant-or-self::*[text()='Site-1-R-4-PatientsReport-7782']] and td[descendant-or-self::*[text()[normalize-space()='2']]] and td[descendant-or-self::*[text()[normalize-space()='2']]] and td[descendant-or-self::*[text()[normalize-space()='1']]] and td[descendant-or-self::*[text()[normalize-space()='0']]] ]
    

    However, i need to get the text for Site-1-R-4-PatientsReport-7782. This is also in the document albeit elsewhere. What would be a most efficient xpath selector to dig it out?

    Sorry still getting used to xpaths so please advise if i can make this clearer


Comments

  • Registered Users, Registered Users 2 Posts: 1,426 ✭✭✭nullObjects


    I think it might just be the syntax that's catching you, try "/text()" maybe?

    If you could post some of the html that might help (obviously you might not be allowed to!)


Advertisement