Hi i have the following code that searches for and retrieves the first paragraph after <h3>
//div[starts-with(@id,'content_div')]/h3[.='Course Content']/following-sibling::p[1]
Because i’m using the same code on multiple web pages, some of those pages do not contain <h3> and instead contain <h4> tag. What is the syntax to check if there is a <h3> tag and if not check for <h4>?
You can check if child element exists using predicate, e.g.:
It will select all
divelements which havespan