escribió:
<td><a href='proxy:name=XROXY proxy&host=96.232.17.210&port=48989&isSocks=true&socksversion=4a¬es=United States&foxyProxyMode=this&confirmation=http://www.whatsmyip.org' title='Configure FoxyProxy in single click'>
<img src='http://www.exroxy.com/images/foxy16x16.gif' border='0' width='17' height='16' alt='Configure FoxyProxy in single click'/></a></td>
<td><a href='/proxy1913485.htm' title='View this Proxy details'>96.232.17.210
<!--
<img src='images/proxy/1913485.gif' border='0' hspace='0' vspace='0' width='140' height='14' alt='View this Proxy details'/>
-->
</a></td>
<td><a href='/proxy-48989---ssl.htm' title='Select proxies with port number 48989'>48989</a></td>
<td><a href='/proxy--Socks4--ssl.htm' title='Select proxies of Socks4 type'>Socks4</a></td>
<td><a href='/proxy----ssl.htm' title='Select proxies with/without SSL support'>true</a></td>
<td nowrap='nowrap'><a href='/proxy---US-ssl.htm' title="Select proxies from United States"><img border='0' width='14' height='14' src='http://www.exroxy.com/images/countries/ext_us.png' alt="Proxy from United States" /><small> United States</small></a></td>
<td>30</td>
<td>100</td>
<td><a href='/proxy1913485.htm' title='View detailed proxy information'>Details</a></td>
<!--
<td><a href='/whois1913485.htm' title='View proxy whois information'>Whois</a></td>
-->
</tr><br><br><br><br><br><tr class='row1'>
<td><a href='proxy:name=XROXY proxy&host=24.93.102.196&port=1877&isSocks=true¬es=United States&foxyProxyMode=this&confirmation=http://www.whatsmyip.org' title='Configure FoxyProxy in single click'>
<img src='http://www.exroxy.com/images/foxy16x16.gif' border='0' width='17' height='16' alt='Configure FoxyProxy in single click'/></a></td>
<td><a href='/proxy1911926.htm' title='View this Proxy details'>24.93.102.196
<!--
<img src='images/proxy/1911926.gif' border='0' hspace='0' vspace='0' width='140' height='14' alt='View this Proxy details'/>
-->
</a></td>
<td><a href='/proxy-1877---ssl.htm' title='Select proxies with port number 1877'>1877</a></td>
<td><a href='/proxy--Socks5--ssl.htm' title='Select proxies of Socks5 type'>Socks5</a></td>
<td><a href='/proxy----ssl.htm' title='Select proxies with/without SSL support'>true</a></td>
<td nowrap='nowrap'><a href='/proxy---US-ssl.htm' title="Select proxies from United States"><img border='0' width='14' height='14' src='http://www.exroxy.com/images/countries/ext_us.png' alt="Proxy from United States" /><small> United States</small></a></td>
<td>30</td>
<td>100</td>
<td><a href='/proxy1911926.htm' title='View detailed proxy information'>Details</a></td>
<!--
<td><a href='/whois1911926.htm' title='View proxy whois information'>Whois</a></td>
-->
</tr><br><br><br><br><br><tr class='row0'>
<td><a href='proxy:name=XROXY proxy&host=68.35.168.243&port=6585&isSocks=true¬es=United States&foxyProxyMode=this&confirmation=http://www.whatsmyip.org' title='Configure FoxyProxy in single click'>
<img src='http://www.exroxy.com/images/foxy16x16.gif' border='0' width='17' height='16' alt='Configure FoxyProxy in single click'/></a></td>
<td><a href='/proxy1916998.htm' title='View this Proxy details'>68.35.168.243
<!--
<img src='images/proxy/1916998.gif' border='0' hspace='0' vspace='0' width='140' height='14' alt='View this Proxy details'/>
-->
</a></td>
<td><a href='/proxy-6585---ssl.htm' title='Select proxies with port number 6585'>6585</a></td>
<td><a href='/proxy--Socks5--ssl.htm' title='Select proxies of Socks5 type'>Socks5</a></td>
<td><a href='/proxy----ssl.htm' title='Select proxies with/without SSL support'>true</a></td>
<td nowrap='nowrap'><a href='/proxy---US-ssl.htm' title="Select proxies from United States"><img border='0' width='14' height='14' src='http://www.exroxy.com/images/countries/ext_us.png' alt="Proxy from United States" /><small> United States</small></a></td>
<td>30</td>
<td>100</td>
<td><a href='/proxy1916998.htm' title='View detailed proxy information'>Details</a></td>
<!--
<td><a href='/whois1916998.htm' title='View proxy whois information'>Whois</a></td>
-->
</tr>
Para lo cual yo utilizo:
Código PHP :
<?php $preg = @preg_match_all("/<tr class='row[(1|0){1}]'>(.*?)<\/tr>/is, $source, $data, PREG_SET_ORDER); for($i=0; $i<count($data); $i++) { print_r($data[$i][0]); } ?>
Y me obtiene lo que está entre <tr> y </tr> correctamente, después intento pasar sobre lo que está entre cada <td> y </td> de la siguiente forma:
Código PHP :
<?php $preg = @preg_match_all("/<tr class='row[(1|0){1}]'>(.*?)<\/tr>/is, $source, $data, PREG_SET_ORDER); for($i=0; $i<count($data); $i++) { //print_r($data[$i][0]); $pat2 = "/<td>(.*)<\/td>/"; $preg = @preg_match_all($pat2, $data[$i][1], $conn, PREG_SET_ORDER); print_r($conn); echo '<br><br>'; } ?>
Y me regresa:
escribió:
Array ( [0] => Array ( [0] => 1877 [1] => 1877 ) [1] => Array ( [0] => Socks5 [1] => Socks5 ) [2] => Array ( [0] => true [1] => true ) [3] => Array ( [0] => 30 [1] => 30 ) [4] => Array ( [0] => 100 [1] => 100 ) [5] => Array ( [0] => Details [1] => Details ) [6] => Array ( [0] => Whois [1] => Whois ) )
Array ( [0] => Array ( [0] => 6585 [1] => 6585 ) [1] => Array ( [0] => Socks5 [1] => Socks5 ) [2] => Array ( [0] => true [1] => true ) [3] => Array ( [0] => 30 [1] => 30 ) [4] => Array ( [0] => 100 [1] => 100 ) [5] => Array ( [0] => Details [1] => Details ) [6] => Array ( [0] => Whois [1] => Whois ) )
Como pueden notar, las primeras dos <td></td> no me las detecta, no se si porque en el codigo fuente (el original) despues de la ultima <td></td> viene un comentario con <!-- --> (ver mas arriba o acontinuación):
escribió:
<!--
<img src='images/proxy/1913485.gif' border='0' hspace='0' vspace='0' width='140' height='14' alt='View this Proxy details'/>
-->
</a></td>
Entonces, supongo que ese comentario hace que el primer <td></td> y el segundo <td></td> no me los detecte.
Aunque estoy empleando /is que como me explicaron en este foro, es para caracteres "especiales" como saltos de línea e incesible a mayus y minus, por lo que no debería dar error porque el comentario está entre <td></td> y en el código fuente no me lo muestra.
Espero su ayuda, gracias.