我正在尝试使用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());
});
});