使用表格属性的Goutte Scraper过滤器

我正在尝试使用Goutte抓取网页。但是我无法使用

之类的属性进行过滤
[@width="100"][@cellspacing = "1"][@border = "0"]

在我的页面中有多个表。

现在我要抓取具有[@ width =“ 100”] [@ cellspacing =“ 1”] [@ border =“ 0”]的表

表格html看起来

<table width="100%" cellspacing="1" border="0">

我正在尝试使用此代码,但无法获取输出

$table = $crawler->filter('table')->attr('width=100','cellspacing=1','border=0')->each(function ($tr)  {
    return $tr->filter('td')->each(function ($td,$i) {
        return trim($td->text());
    });
});
lxt2015 回答:使用表格属性的Goutte Scraper过滤器

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3105104.html

大家都在问