https://github.com/hkk12369/php-html-parser
A HTML/XML parser written in php using its inbuilt DOMDocument. Supports both CSS and XPath queries. Handles Malformed HTML.
https://github.com/hkk12369/php-html-parser
Last synced: about 2 months ago
JSON representation
A HTML/XML parser written in php using its inbuilt DOMDocument. Supports both CSS and XPath queries. Handles Malformed HTML.
- Host: GitHub
- URL: https://github.com/hkk12369/php-html-parser
- Owner: hkk12369
- Created: 2012-09-06T17:01:23.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-11-19T07:21:31.000Z (over 11 years ago)
- Last Synced: 2025-03-25T15:53:06.036Z (2 months ago)
- Language: PHP
- Size: 121 KB
- Stars: 8
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
PHP HTML Parser
===============A simple and efficient DOMDocument based PHP HTML and XML Parser. It accepts both css selector and xpath queries to search the document and handles malformed HTML as well.
Example:
```php
$html = HtmlParser::from_string('Some Text');
$text = $html->find('#outer .red', 0)->text;
echo $text; // outputs "Some Text"
```