Symfony DomCrawler如何在Javascript中搜索

时间:2014-07-05 15:41:19

标签: php symfony dom web-crawler goutte

我正在使用Goutte抓取网页

我使用block来查找节点

$data = $crawler->filter('script');

如果我只想要第一个节点

$data = $crawler->filter('script')->first(); //is that right?

然后如何找到“A LINK”?我震惊了这个js块

<script>

   jwplayer( "clipplayer" ).setup({ 
      image: imgurl,
      playlist: [{              
          sources: [{
              bitrate: "640",
              file: "A LINK",
              label: "640SD",
              type: "video/mp4",
              provider: "video"},]                               
      }],               
      width: 728,
      height: 450,
      primary: 'flash'
   });

</script>

1 个答案:

答案 0 :(得分:1)

我得到它只是将其转换为html并使用preg_match_all();