简体   繁体   English

symfony crawler 无法在此站点上运行

[英]symfony crawler not work from this site

I want to get data from this site but symfony crawler not worked for http://www.varzesh3.com/livescore/feed and the string does not gain我想从这个站点获取数据,但 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";
});

I Solved it我解决了

get data by Guzzle php and then pass body to symfony crawler通过Guzzle php获取数据,然后将 body 传递给 symfony crawler

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM