Extraer datos en php

Iniciado por deth, Febrero 16, 2016, 03:37:47 PM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Febrero 16, 2016, 03:37:47 PM Ultima modificación: Febrero 16, 2016, 07:51:45 PM por Expermicid
hola amigos, como podria extraer el titulo de los post que esten en esta sección de este foro usando php? aqui mi codigo que no me funciona:

Código: php


$page = file_get_contents('https://underc0de.org/foro/underc0de');

preg_match_all("/<span id=\"msg_96454\".*td>/", $page, $agent_name);


print_r($agent_name);


gracias de antemano.


You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Pentest - Hacking & Security Services

Contact me: You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

oye gracias pero en ninguno de esos links dice como hacer lo que yo pido exactamente

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
oye gracias pero en ninguno de esos links dice como hacer lo que yo pido exactamente
Solo hay que leer un poquito mas los links que te pase y veras que:
Pentest - Hacking & Security Services

Contact me: You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
oye gracias pero en ninguno de esos links dice como hacer lo que yo pido exactamente
Solo hay que leer un poquito mas los links que te pase y veras que:

oye gracias amigo pero fijate que lo lei todo y lo que hay es algo parecido mas no igual, y de paso tiene un link caido y no puedo realizar el ejercicio que sale ahi You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
oye gracias pero en ninguno de esos links dice como hacer lo que yo pido exactamente
Solo hay que leer un poquito mas los links que te pase y veras que:

oye gracias amigo pero fijate que lo lei todo y lo que hay es algo parecido mas no igual, y de paso tiene un link caido y no puedo realizar el ejercicio que sale ahi You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
No estoy en casa ahora mismo... pero llegando hare eso que pides utilizando ese post como referencia :')
Pentest - Hacking & Security Services

Contact me: You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Febrero 18, 2016, 01:42:22 AM #6 Ultima modificación: Febrero 18, 2016, 01:51:07 AM por arthusu
Aqui tienes la libreria: You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Código: php
<?php

require_once('simple_html_dom.php');

$html = file_get_html('https://underc0de.org/foro/dudas-generales-121');
$links = $html->find('.subject_title a');
foreach($links as $element) {
echo $element->plaintext . '<br>';
}

?>


Resultado:



Si quieres que siga recorriendo entre las paginas tienes que hacer un bucle (usando cURL), puedes buscar recursion :') Saludos! xD
Pentest - Hacking & Security Services

Contact me: You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login