crwlrsoft / crawler

Library for Rapid (Web) Crawler and Scraper Development
https://www.crwlr.software/packages/crawler
MIT License
312 stars 11 forks source link

Validate CSS Selectors and XPath Queries earlier #125

Closed otsch closed 7 months ago

otsch commented 7 months ago

When creating a CssSelector or XPathQuery instance with invalid selector/query syntax, an InvalidDomQueryException is now immediately thrown. This change is considered to be not only non-breaking, but actually a fix, because the CssSelector would otherwise throw an exception later when the apply() method is called. The XPathQuery would silently return no result without notifying you of the invalid query and generate a PHP warning.