Note that there are some explanatory texts on larger screens.

plurals
  1. POGet text between repeating <tr></tr> tags
    primarykey
    data
    text
    <p>I got head-ache trying to solve this problem. I have a structure like this:</p> <pre><code>&lt;tr&gt; &lt;td width="10%" bgcolor="#FFFFFF"&gt;&lt;font class="bodytext9"&gt;17-Aug-2013&lt;/font&gt;&lt;/td&gt; &lt;td width="4%" bgcolor="#FFFFFF" align=center&gt;&lt;font class="bodytext9"&gt;Sat&lt;/font&gt;&lt;/td&gt; &lt;td width="4%" bgcolor="#FFFFFF" align="center"&gt;&lt;font class="bodytext9"&gt;5 PM&lt;/font&gt;&lt;/td&gt; &lt;td width="15%" bgcolor="#FFFFFF" align="center"&gt;&lt;a class="black_9" href="teams.asp?teamno=766&amp;leagueNo=115"&gt;XYZ Club FC&lt;/a&gt;&lt;/td&gt; &lt;td width="5%" bgcolor="#FFFFFF" align="center"&gt;&lt;font class="bodytext9"&gt;&lt;img src="img/colors/white.gif"&gt;&lt;/font&gt;&lt;/td&gt; &lt;td width="5%" bgcolor="#FFFFFF" align="center"&gt;&lt;/td&gt; &lt;td width="5%" bgcolor="#FFFFFF" align="center"&gt;&lt;font class="bodytext9"&gt;vs&lt;/font&gt;&lt;/td&gt; &lt;td width="5%" bgcolor="#FFFFFF" align="center"&gt;&lt;/td&gt; &lt;td width="5%" bgcolor="#FFFFFF" align="center"&gt;&lt;font class="bodytext9"&gt;&lt;img src="img/colors/orange.gif"&gt;&lt;/font&gt;&lt;/td&gt; &lt;td width="15%" bgcolor="#FFFFFF" align="center"&gt;&lt;a class="black_9" href="teams.asp?teamno=632&amp;leagueNo=115"&gt;ABC Football Club&lt;/a&gt;&lt;/td&gt; &lt;td width="15%" bgcolor="#FFFFFF" align="center"&gt;&lt;a href="pitches.asp?id=151" class=list&gt;&lt;u&gt;APSM Pitch &lt;/u&gt;&lt;/a&gt;&lt;/td&gt; &lt;td width="4%" bgcolor="#FFFFFF" align="center"&gt;&lt;a target="_new" href="matchpreview_frame.asp?matchno=20877"&gt;&lt;img src="img/matchpreview_symbol.gif" border="0"&gt;&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; </code></pre> <p>this format will repeat many times with different text contain, sometime, some text contain is similar. I need to extract ONLY the FIRST group of this format, where it contain "ABC Football Club" the FIRST TIME (because it could appear many times later also). How do I do that and extract the text on each line ? </p> <p>Thanks for the comments, I editted here to add some codes I tried:</p> <pre><code> $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'url link'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $html = curl_exec($ch); curl_close($ch); $dom = new DOMDocument(); @$dom-&gt;loadHTML($html); $xpath = new DOMXPath($dom); $trs = $xpath-&gt;query('//tr/td[contains(.,'ABC Football Club')]'); $rows = array(); foreach($trs as $tr) $rows[] = innerHTML($tr, true); // this function I don't include here print_r($rows); </code></pre> <p>However this one not work! :(</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload