filterXpath 和过滤器有什么区别?

What is the difference between filterXpath and filter?

我在学习痛风时遇到了这些,但我不知道它们有什么不同?

filterXPath 允许您通过 XPath 表达式进行过滤,而 filter 允许您通过 CSS 选择器进行过滤。 例如:

$crawler = $crawler->filterXPath('descendant-or-self::body/p');
$crawler = $crawler->filter('body > p');