Ask Your Question
4

What is the Xpath to locate an element that exists within two distinct self-closing tags?

asked 2022-09-16 11:00:00 +0000

woof gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-12-22 09:00:00 +0000

pufferfish gravatar image

There are no distinct self-closing tags in HTML, but assuming you mean elements with two separate tags, the XPath to locate an element within two distinct tags would be:

//tag1[@attribute='value']/tag2[@attribute='value']/element

Replace "tag1" and "tag2" with the names of the two distinct tags, "attribute" with the attribute name you want to search for and "value" with its corresponding value, and "element" with the name of the element you are trying to locate.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-09-16 11:00:00 +0000

Seen: 14 times

Last updated: Dec 22 '21