symfony crawler无法从此站点工作

时间:2017-01-11 11:57:31

标签: php symfony domcrawler

我想从此网站获取数据,但symfony抓取工具无法用于http://www.varzesh3.com/livescore/feed且字符串无法获取

<?php

//echo __DIR__.'/vendor/autoload.php';
require_once __DIR__.'/vendor/autoload.php';


use Symfony\Component\DomCrawler\Crawler;


$html2 = file_get_contents('http://www.varzesh3.com/livescore/feed');

$crawler = new Crawler($html2);


$atc =  $crawler->filter('.stage-wrapper')->each(function (Crawler $nodeCrawler)
{
    var_dump($nodeCrawler->html());
    echo "a";
});

1 个答案:

答案 0 :(得分:0)

我解决了它

通过Guzzle php获取数据,然后将body传递给symfony crawler