私は大まかに次のような大きなデータテーブルを用意しています。下記の要望は、単純化ではなく完全なサンプルです。XPathの選択要素とそれに続く要素
<table class="grid resultRaceGrid" id="mainGrid">
<tr>
<th width="10"> </th>
<th> </th>
<th> </th>
<th>HORSE/SP</th>
<th>AGE</th>
<th>WGT</th>
<th>TRAINER/JOCKEY</th>
<th>OR</th>
<th>TS</th>
<th>RPR</th>
<th width="10"> </th>
</tr>
<tr>
<td colspan="11" class="separator"> </td>
</tr>
<tr>
<td rowspan="2" class="last"><a href="/horses/result_home.sd?race_id=443557&r_date=2007-11-21&popup=yes" class="bull"><b>«</b></a></td>
<td rowspan="2" class="nowrap noPad"><h3>1 </h3></td>
<td rowspan="2" class="dstDesc"></td>
<td class="nowrap"><span class="black"><a href="#" id="noteIcon_673823" class="pencil" onclick="return false;"><!-- --></a><b><a href="/horses/horse_home.sd?horse_id=673823" onclick="return popup(this, {width:695, height:800})" title="Full details about this HORSE">Andytown</a></b> (IRE) 6/4F <img src="http://ui.racingpost.com/ico/tipping-success.gif" class="shilda" title="Tipped by Topspeed" alt="" /></span></td>
<td class="black">5</td>
<td class="nowrap black"><span>11-1 <span class="lightGray"></span></span></td>
<td class="nowrap black"><a href="/horses/trainer_home.sd?trainer_id=13176" onclick="return popup(this, {width:695, height:800})" title="Full details about this TRAINER">N G Richards</a></td>
<td rowspan="2" class="lightGray">—</td>
<td rowspan="2" class="lightGray"><span class="red bold">*</span></td>
<td rowspan="2" class="last"><span class="red bold">*</span></td>
<td rowspan="2" class="last"><a href="/horses/result_home.sd?race_id=450083&r_date=2008-03-08&popup=yes" class="bull"><b>»</b></a></td>
</tr>
<tr>
<td colspan="3"><span class="pedigrees">ch g <a href="/bloodstock/stallionbook/stallion_home.sd?horse_id=42337&popup=1" onclick="return popup(this, {width:734, height:800})" title="Full details about this STALLION">Old Vic</a> - <a href="/bloodstock/dam_home.sd?horse_id=519458" onclick="return popup(this, {width:695, height:800})" title="Full details about this DAM ">Pitfire (IRE)</a> (<a href="/bloodstock/stallionbook/stallion_home.sd?horse_id=303796&popup=1" onclick="return popup(this, {width:734, height:800})" title="Full details about this STALLION">Parliament</a>)</span></td>
<td class="lightGray"><a href="/horses/jockey_home.sd?jockey_id=82320" onclick="return popup(this, {width:695, height:800})" title="Full details about this JOCKEY">Fearghal Davis</a><sup>5</sup></td>
</tr>
<tr class="rowComment hideComment">
<td colspan="3"> </td>
<td colspan="7"><div class="commentText"> Went prominent 6th, challenged 2 out, soon ridden, narrow advantage last, forged clear towards finish (tchd 7-4)</div></td>
<td> </td>
</tr>
<tr>
<td colspan="11" class="separator"> </td>
</tr>
次のXPathを使用すると、関心のある行全体を正しく一致させることができます。
私の質問はです:どのように私は(それ以下)には、次の2つの要素tr
と一緒にこのtr
を選択することができます。
あなたの例には「」要素はありません。 XPathを適用できるサンプルを提供してください。 – Gordon
@ gordon。コードサンプルが更新されました。 –
※ご質問は一切ありません!また、「次の2つの行と一致させたい」という文もあります。意味がありません。どのような2つの行ですか?どの2つの行?あなたは遭遇した問題は何ですか?どうか明らかにしてください。 –