DOMCrawler:如何选择" a"中的所有链接标签和"区域"标签

时间:2015-11-29 16:35:49

标签: php domcrawler

我希望获得一个页面上显示的所有链接的列表。 其中一些链接位于area标记中。

所以我这样做是为了获得所有链接的完整列表:

// Get the a links
$links = $crawler->filter('a')->links();

// Append the links in area tag (clicakble images)
$links = array_merge($links, $crawler->filter('area')->links());

有没有办法直接在filter方法中选择a代码和area代码中的所有链接,这样我就没有了使用array_merge功能?

0 个答案:

没有答案
相关问题