jQuery-like selectors for PHP DOMDocument

前端 未结 5 1423
北荒
北荒 2021-02-01 06:44

I\'m working with a DOMDocument, and I\'m wondering if there exists some way of using CSS-like selectors to select nodes like we would in jQuery.

Example situation: I\'m

5条回答
  •  故里飘歌
    2021-02-01 07:08

    You can use the Symfony DomCrawler component, enabling you to use css selectors for DOM traversing: https://packagist.org/packages/symfony/dom-crawler

提交回复
热议问题