A simple and fast HTML and XML parser for PHP with CSS selector and XPath support.
DiDOM is a PHP library for parsing HTML and XML documents, designed for simplicity and performance. It provides a fluent API for navigating and manipulating document elements, making web scraping and data extraction tasks straightforward.
PHP developers who need to parse, scrape, or manipulate HTML/XML documents, particularly those working on web scraping, data extraction, or document transformation projects.
Developers choose DiDOM for its clean, object-oriented API that supports both CSS selectors and XPath queries, along with built-in caching for performance and intuitive methods for element manipulation and output formatting.
Simple and fast HTML and XML parser
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports both CSS selectors and direct XPath queries, with automatic CSS-to-XPath conversion for familiar syntax and flexibility in document traversal.
Provides intuitive methods like setInnerHtml, replace, and remove for easy document changes, as shown in the README's 'Changing content' section.
Caches compiled XPath expressions to improve speed on repeated queries, enhancing efficiency for scraping tasks that involve multiple similar operations.
Loads HTML/XML from strings, files, or URLs with configurable encoding and libxml options, supporting various input sources out of the box.
Cannot parse or interact with dynamically loaded content, making it ineffective for modern websites that rely on client-side rendering.
Element replacement and removal only work if elements are found directly in the document, leading to potential confusion and bugs, as warned in the README.
Basic URL loading without integrated support for sessions, cookies, or advanced HTTP client capabilities, requiring additional libraries for complex scraping.
Has fewer community extensions and integrations compared to alternatives like Symfony DomCrawler, limiting ready-made solutions for common scraping challenges.