{"id":21868364,"url":"https://github.com/pmvc-plugin/html_parser","last_synced_at":"2026-05-12T23:38:44.288Z","repository":{"id":34574173,"uuid":"38520469","full_name":"pmvc-plugin/html_parser","owner":"pmvc-plugin","description":null,"archived":false,"fork":false,"pushed_at":"2021-08-12T08:31:58.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-26T16:21:55.793Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pmvc-plugin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-04T03:41:06.000Z","updated_at":"2021-08-12T08:32:00.000Z","dependencies_parsed_at":"2022-09-14T14:20:50.257Z","dependency_job_id":null,"html_url":"https://github.com/pmvc-plugin/html_parser","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmvc-plugin%2Fhtml_parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmvc-plugin%2Fhtml_parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmvc-plugin%2Fhtml_parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmvc-plugin%2Fhtml_parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pmvc-plugin","download_url":"https://codeload.github.com/pmvc-plugin/html_parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244874743,"owners_count":20524582,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T05:12:42.200Z","updated_at":"2025-10-29T04:11:32.716Z","avatar_url":"https://github.com/pmvc-plugin.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Latest Stable Version](https://poser.pugx.org/pmvc-plugin/html_parser/v/stable)](https://packagist.org/packages/pmvc-plugin/html_parser) \n[![Latest Unstable Version](https://poser.pugx.org/pmvc-plugin/html_parser/v/unstable)](https://packagist.org/packages/pmvc-plugin/html_parser) \n[![Build Status](https://travis-ci.org/pmvc-plugin/html_parser.svg?branch=master)](https://travis-ci.org/pmvc-plugin/html_parser)\n[![License](https://poser.pugx.org/pmvc-plugin/html_parser/license)](https://packagist.org/packages/pmvc-plugin/html_parser)\n[![Total Downloads](https://poser.pugx.org/pmvc-plugin/html_parser/downloads)](https://packagist.org/packages/pmvc-plugin/html_parser) \n\nHtml Parser \n===============\n\n## How to use?\n public function css($content, $selector)\n\n```\ninclude('vendor/autoload.php');\nPMVC\\Load::plug();\n$plug = \\PMVC\\plug('html_parser');\n$object = $plug-\u003ecss($html, $your_css_$selector);\nvar_dump($object-\u003ehtml());\n```\n\n## Useful tip\n\n### text or html\n* object-\u003etext()\n* object-\u003ehtml()\n\n### get tag attribute\n* object-\u003eattr('href')\n\n### Process a list (QueryPath)\n* https://web.archive.org/web/20120504094800/http://api.querypath.org/docs/class_query_path.html\n* Get one index\n```\n   $DOMElement = QueryPath-\u003eget(int index)                  // start from zero\n   \\PMVC\\plug('html_parser')-\u003ecss($DOMElement, $selector);\n```\n\n### Parse Engine\n   * Old Api(better):\n      * https://web.archive.org/web/20130123082558/http://api.querypath.org/docs/\n   * https://github.com/technosophos/querypath\n\n## Install with Composer\n### 1. Download composer\n   * mkdir test_folder\n   * curl -sS https://getcomposer.org/installer | php\n\n### 2. Install Use composer.json or use command-line directly\n#### 2.1 Install Use composer.json\n   * vim composer.json\n```\n{\n    \"require\": {\n        \"pmvc-plugin/html_parser\": \"dev-master\"\n    }\n}\n```\n   * php composer.phar install\n\n#### 2.2 Or use composer command-line\n   * php composer.phar require pmvc-plugin/html_parser\n   \n   or\n   * composer require pmvc-plugin/html_parser\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmvc-plugin%2Fhtml_parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpmvc-plugin%2Fhtml_parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmvc-plugin%2Fhtml_parser/lists"}