Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

XPATH: Finding text inside the selector

Options
  • 15-05-2017 9:11pm
    #1
    Registered Users Posts: 5,550 ✭✭✭


    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 Posts: 1,299 ✭✭✭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