Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/01/2014, 13:54
fumondj
 
Fecha de Ingreso: octubre-2006
Mensajes: 471
Antigüedad: 17 años, 6 meses
Puntos: 1
problema al hacer scrap

Hola buenas,

necesito scrapear un dato de un sitio web, tengo este codigo:

Código PHP:
    $link=$_GET['jm'];
    
$url 'http://www.example.net/es/example/'.$link.'.html';
    
$pagina file_get_contents($url);
    
$pagina utf8_decode(utf8_encode(utf8_decode($pagina)));
    
$jm_anime_genero cut_str($pagina'<tr>
    <td width="133" align="right" valign="top">Genero : </td>
    <td width="329" align="left" valign="top">'
'</td>
    </tr>'
);
    
preg_match_all('/[<a[^>]*?>(.*)<\/a>/i'$jm_anime_genero$matches);
    if(
$matches === false || count($matches) == 0) return false;
    echo 
implode(', '$matches[1]); 
Pero me imprime esto:

Código PHP:
    Drama<a href="http://www.example.net/es/peliculas/x">Accion</a><a href="http://www.example.net/es/peliculas/x">Biografias</a><a href="http://www.example.net/es/peliculas/x">Deporte 
Y necesito que me imprima esto:

Código PHP:
DramaAccionBiografiasDeporte 
espero que puedan ayudarme, saludos y que tengan un buen año nuevo.