Php symfony爬虫程序无法从此站点运行
我想从这个网站上获取数据,但symfony crawler没有工作,字符串也没有增益Php symfony爬虫程序无法从此站点运行,php,symfony,domcrawler,Php,Symfony,Domcrawler,我想从这个网站上获取数据,但symfony crawler没有工作,字符串也没有增益 <?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'
<?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";
});
我解决了它
获取数据,然后将正文传递给symfony crawler您从
var_dump($nodeCrawler->html())中得到了什么代码>你必须使用CssSelector组件,我没有得到任何变量转储($nodeCrawler->html());'$爬虫->过滤器'没有返回任何值,请阅读此内容并重试。将粘贴代码从那里复制到这里是不好的-