How to write xpath to count <P> tag between two <h2> tag?

barsogBoose

New Member
\[code\]<p><p><h2><p><ul><p>and two special regions:</p><ul><h2> <span class="editsection"> <span id="History" class="mw-headline">History</span></h2><div class="thumb tleft"><p><p><h3><p><div class="thumb tright"><div class="thumb tright"><p><p><h3><p><h3><div class="thumb tright"><p><p><p><p><p><p><h3><p><h2> <span class="editsection"> <span id="Demography" class="mw-headline">Demography</span></h2><div class="thumb tright"><p><div class="thumb tright"><p><table class="wikitable sortable jquery-tablesorter"><p><p><p>\[/code\]How to count the number of \[code\]<P>\[/code\] tags in between two \[code\]<h2>\[/code\] tags?Start with tag\[code\]<h2> <span class="editsection"> <span id="History" class="mw-headline">History</span></h2>\[/code\]and\[code\]<h2> <span class="editsection"> <span id="Demography" class="mw-headline">Demography</span></h2>\[/code\]the xpath should retreive 13 \[code\]<p>\[/code\] tags between these two \[code\]<h2>\[/code\] tag. So how to do write xpath for this?Note: Tags \[code\]<p>\[/code\] \[code\]<h2>\[/code\] \[code\]<h3>\[/code\] \[code\]<ul>\[/code\] \[code\]<div>\[/code\] are siblings.\[code\]<p>\[/code\] tags and \[code\]<h2>\[/code\] tags does't contain any of the attribute.
 
Back
Top