{"id":15524162,"url":"https://github.com/theseer/css2xpath","last_synced_at":"2026-03-10T04:02:57.402Z","repository":{"id":57068530,"uuid":"108770917","full_name":"theseer/css2xpath","owner":"theseer","description":"PHP Library to translate CSS selectors into XPath","archived":false,"fork":false,"pushed_at":"2024-02-12T13:22:10.000Z","size":22,"stargazers_count":7,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-25T08:50:04.944Z","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":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theseer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-29T20:59:55.000Z","updated_at":"2025-04-20T07:39:20.000Z","dependencies_parsed_at":"2025-03-05T10:33:20.759Z","dependency_job_id":"fb0eaf52-931b-404f-abf2-28c1dc8c08ff","html_url":"https://github.com/theseer/css2xpath","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/theseer/css2xpath","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theseer%2Fcss2xpath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theseer%2Fcss2xpath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theseer%2Fcss2xpath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theseer%2Fcss2xpath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theseer","download_url":"https://codeload.github.com/theseer/css2xpath/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theseer%2Fcss2xpath/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265432408,"owners_count":23764089,"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-10-02T10:49:22.146Z","updated_at":"2026-03-10T04:02:52.261Z","avatar_url":"https://github.com/theseer.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSS2XPath\n\nThis is yet another library to translate various CSS selectors to their XPath equivalent.\n\n[![Build Status](https://travis-ci.org/theseer/css2xpath.svg?branch=master)](https://travis-ci.org/theseer/css2xpath)\n[![Latest Stable Version](https://img.shields.io/packagist/v/theseer/css2xpath.svg)](https://packagist.org/packages/theseer/css2xpath)\n\n## Example\n\n```php\n\n$translator = new TheSeer\\CSS2XPath\\Translator();\n\n// Will output //*[contains(concat(\" \",normalize-space(@class),\" \"),\" note \")]\necho $translator-\u003etranslate('.note');\n\n// Will output //*[@id=\"me\"]\necho $translator-\u003etranslate('#me');\n```\n\n## Installation\n\nYou can add this library as a local, per-project dependency to your project using Composer:\n\n```\ncomposer require theseer/css2xpath\n```\n\n## Selectors supported\n\nThe following selectors are currently covered:\n\n- #id\n- tag#id\n- tag #id\n- tag\n- tag tag\n- tag \u003e tag\n- tag + tag\n- tag ~ tag\n- tag, tag\n- .classname\n- tag.classname\n- tag .classname\n- tag.classname, tag.classname\n- tag.classname tag.classname\n- tag.classname \u003e tag.classname\n- tag#id + tag \u003e tag\n- tag[id]:contains(Selectors)\n- tag[attribute][attribute]\n- tag[attribute]\n- tag[attribute=example]\n- tag[attribute^=exa]\n- tag[class$=mple]\n- tag[attribute*=e]\n- tag[attribute|=dialog]\n- tag[attribute!=made_up]\n- tag[attribute!=\"made_up\"]\n- tag[attribute~=example]\n- tag:not(.classname)\n- tag:contains(selectors)\n- tag:nth-child(n)\n- tag:nth-child(even)\n- tag:nth-child(odd)\n- tag:nth-child(3n+8)\n- tag:nth-child(2n+1)\n- tag:nth-child(3)\n- tag:nth-child(4n)\n- tag:only-child\n- tag:last-child\n- tag:first-child\n- foo|bar\n- tag[attribute^=exa][attribute$=mple]\n- tag:enabled\n- tag:checked\n- tag:disabled\n- :empty\n- :root\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheseer%2Fcss2xpath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheseer%2Fcss2xpath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheseer%2Fcss2xpath/lists"}