Foros del Web » Programando para Internet » PHP »

HTML DOM Parser Obtener tag "script"

Estas en el tema de HTML DOM Parser Obtener tag "script" en el foro de PHP en Foros del Web. Buenas, estoy programando un crawler de un diario y recupero un tipo particular de noticias donde hay un carousel con muchas imagenes. Por lo que ...
  #1 (permalink)  
Antiguo 04/04/2016, 11:49
 
Fecha de Ingreso: marzo-2011
Ubicación: Mendoza
Mensajes: 15
Antigüedad: 13 años
Puntos: 0
HTML DOM Parser Obtener tag "script"

Buenas, estoy programando un crawler de un diario y recupero un tipo particular de noticias donde hay un carousel con muchas imagenes. Por lo que he visto, dentro del tag "img" del carousel asigna dinamicamente la url de la imagen que esta seleccionada en el carousel. Pero hay un tag "script" donde tiene codigo con los enlaces de todas las imagenes. Estoy intentando recuperarlo pero no puedo.

Hago lo siguiente:

Código PHP:
$data31 $this->html->getElementById('vplfgp_embeb');
$data32 $data31->find('script'0); 
Pero cuando intento recuperar el texto javascript, me devuelve "", porque?

El texto a devolver seria el siguiente:

Código:
var vplfgo_popup_title='La Terraza citadina vibró con el talento de Felipe Staiti'; var vplfgo_popup  = null;vsm.loadScript('/portal/js/fgal.js?3.1.756.11',function (){waitobj('vplfgal',['popup',[{"i":"/files/image/669/669095/56e2bdd1cd588__500!.jpg?d=1457795569","w":"1366","h":"760","c":"Alexis Hernández, Natalia Fernández, Bruna Kappler y Ana Sandoval","s":"Gentileza","mq":[{"mq":"screen and (min-device-pixel-ratio:2)","i":"/files/image/669/669095/56e2bdd1cd588__1000!.jpg?d=1459723991"},{"mq":"screen and (min-width: 1280px)","i":"/files/image/669/669095/56e2bdd1cd588__500!.jpg?d=1457795569"},{"mq":"screen and (min-width: 1280px and min-device-pixel-ratio:2)","i":"/files/image/669/669095/56e2bdd1cd588__1000!.jpg?d=1459723991"},{"mq":"screen and (max-width: 1023px)","i":"/files/image/669/669095/56e2bdd1cd588__404!.jpg?d=1458509685"},{"mq":"screen and (max-width: 1023px and min-device-pixel-ratio:2)","i":"/files/image/669/669095/56e2bdd1cd588__808!.jpg?d=1459791158"},{"mq":"screen and (max-width: 767px)","i":"/files/image/669/669095/56e2bdd1cd588__246!.jpg?d=1459791158"},{"mq":"screen and (max-width: 767px and min-device-pixel-ratio:2)","i":"/files/image/669/669095/56e2bdd1cd588__492!.jpg?d=1459791158"},{"mq":"screen and (max-width: 480px)","i":"/files/image/669/669095/56e2bdd1cd588__246!.jpg?d=1459791158"},{"mq":"screen and (max-width: 480px and min-device-pixel-ratio:2)","i":"/files/image/669/669095/56e2bdd1cd588__492!.jpg?d=1459791158"},{"mq":"screen and (max-width: 479px)","i":"/files/image/669/669095/56e2bdd1cd588__240!.jpg?d=1458222156"},{"mq":"screen and (max-width: 479px and min-device-pixel-ratio:2)","i":"/files/image/669/669095/56e2bdd1cd588__480!.jpg?d=1459731007"}]},{"i":"/files/image/669/669093/56e2bdc5af8f8__500!.jpg?d=1457795570","w":"1366","h":"760","c":"Felipe Staiti, un capo total","s":"Gentileza","mq":[{"mq":"screen and (min-device-pixel-ratio:2)","i":"/files/image/669/669093/56e2bdc5af8f8__1000!.jpg?d=1459791158"},{"mq":"screen and (min-width: 1280px)","i":"/files/image/669/669093/56e2bdc5af8f8__500!.jpg?d=1457795570"},{"mq":"screen and (min-width: 1280px and min-device-pixel-ratio:2)","i":"/files/image/669/669093/56e2bdc5af8f8__1000!.jpg?d=1459791158"},{"mq":"screen and (max-width: 1023px)","i":"/files/image/669/669093/56e2bdc5af8f8__404!.jpg?d=1458509685"},{"mq":"screen and (max-width: 1023px and min-device-pixel-ratio:2)","i":"/files/image/669/669093/56e2bdc5af8f8__808!.jpg?d=1459723906"},{"mq":"screen and (max-width: 767px)","i":"/files/image/669/669093/56e2bdc5af8f8__246!.jpg?d=1459791158"},{"mq":"screen and (max-width: 767px and min-device-pixel-ratio:2)","i":"/files/image/669/669093/56e2bdc5af8f8__492!.jpg?d=1459724265"},{"mq":"screen and (max-width: 480px)","i":"/files/image/669/669093/56e2bdc5af8f8__246!.jpg?d=1459791158"},{"mq":"screen and (max-width: 480px and min-device-pixel-ratio:2)","i":"/files/image/669/669093/56e2bdc5af8f8__492!.jpg?d=1459724265"},{"mq":"screen and (max-width: 479px)","i":"/files/image/669/669093/56e2bdc5af8f8__240!.jpg?d=1458222156"},{"mq":"screen and (max-width: 479px and min-device-pixel-ratio:2)","i":"/files/image/669/669093/56e2bdc5af8f8__480!.jpg?d=1459723934"}]},{"i":"/files/image/669/669100/56e2be0fbb07a__500!.jpg?d=1457795569","w":"1366","h":"760","c":"Martina y Tomás Llanese","s":"Gentileza","mq":[{"mq":"screen and (min-device-pixel-ratio:2)","i":"/files/image/669/669100/56e2be0fbb07a__1000!.jpg?d=1459723929"},{"mq":"screen and (min-width: 1280px)","i":"/files/image/669/669100/56e2be0fbb07a__500!.jpg?d=1457795569"},{"mq":"screen and (min-width: 1280px and min-device-pixel-ratio:2)","i":"/files/image/669/669100/56e2be0fbb07a__1000!.jpg?d=1459723929"},{"mq":"screen and (max-width: 1023px)","i":"/files/image/669/669100/56e2be0fbb07a__404!.jpg?d=1458509685"},{"mq":"screen and (max-width: 1023px and min-device-pixel-ratio:2)","i":"/files/image/669/669100/56e2be0fbb07a__808!.jpg?d=1459731008"},{"mq":"screen and (max-width: 767px)","i":"/files/image/669/669100/56e2be0fbb07a__246!.jpg?d=1459791158"},{"mq":"screen and (max-width: 767px and min-device-pixel-ratio:2)","i":"/files/image/669/669100/56e2be0fbb07a__492!.jpg?d=1459724521"},{"mq":"screen and (max-width: 480px)","i":"/files/image/669/669100/56e2be0fbb07a__246!.jpg?d=1459791158"},{"mq":"screen and (max-width: 480px and min-device-pixel-ratio:2)","i":"/files/image/669/669100/56e2be0fbb07a__492!.jpg?d=1459724521"},{"mq":"screen and (max-width: 479px)","i":"/files/image/669/669100/56e2be0fbb07a__240!.jpg?d=1458222156"},{"mq":"screen and (max-width: 479px and min-device-pixel-ratio:2)","i":"/files/image/669/669100/56e2be0fbb07a__480!.jpg?d=1459731592"}]},{"i":"/files/image/669/669096/56e2bdd782a38__500!.jpg?d=1457795569","w":"1366","h":"760","c":"Julieta Yazlli, Vanina Sáez, Vainna Lanza, Ana Perlino y Lili Lauro","s":"Gentileza","mq":[{"mq":"screen and (min-device-pixel-ratio:2)","i":"/files/image/669/669096/56e2bdd782a38__1000!.jpg?d=1459731408"},{"mq":"screen and (min-width: 1280px)","i":"/files/image/669/669096/56e2bdd782a38__500!.jpg?d=1457795569"}

Etiquetas: dom, html, parser, tag
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 11:44.