The divs below appear in that order in the HTML I am parsing.
//div[contains(@class,'top-container')]//font/text()
I'm using the xpath expression above to try to get any data in the first div below in which a hyphen is used to delimit the data:
Wednesday - Chess at Higgins Stadium
Thursday - Cook-off
The problem is I am getting data from the second div below such as:
Monday 10:00 - 11:00
Tuesday 10:00 - 11:00
How do I only retrieve the data from the first div? (I also want to exclude any elements in the first div that do not contain this hyphenated data)?
<div class="top-container">
<div dir="ltr">
<div dir="ltr"><font face="Arial" color="#000000" size="2">Wednesday - Chess at Higgins Stadium</font></div>
<div dir="ltr"><font face="Arial" size="2">Thursday - Cook-off</font></div>
<div dir="ltr"><font face="Arial" size="2"></font> </div>
<div dir="ltr"> </div>
<div dir="ltr"><font face="Arial" color="#000000" size="2"></font> </div>
</div>
<div dir="ltr">
<div RE><font face="Arial">
<div dir="ltr">
<div RE><font face="Arial" size="2"><strong>Alex Dawkin </strong></font></div>
<div RE><font face="Arial" size="2">Monday 10:00 - 11:00 </font></div>
<div RE><font size="2">Tuesday 10:00 - 11:00 </font></div>
<div RE>
<div RE><font face="Arial" size="2"></font></div><font face="Arial" size="2"></font></div>
<div RE> </div>
<div RE> </div>