韩川川
韩川川

Reputation: 11

PHP DomCrawler ,Get child node based on a specific parent

Get child node based on a specific parent

function(Crawler $node,){
    $node->filter('this>ul');
}

How can I get a $node children,that does not contain a grandson like the CSS selector #parent>child ?

Upvotes: 1

Views: 2023

Answers (1)

michail_w
michail_w

Reputation: 4471

  1. You are using CSS selector.
  2. There aren't any this or parent selector in CSS.
  3. You should use just $node->filter('>ul');

Upvotes: 2

Related Questions