{"id":50844163,"url":"https://github.com/suhteevah/wraith-dom","last_synced_at":"2026-06-14T08:05:41.619Z","repository":{"id":349734421,"uuid":"1199750207","full_name":"suhteevah/wraith-dom","owner":"suhteevah","description":"no_std HTML parser with CSS selectors and Cloudflare challenge solver","archived":false,"fork":false,"pushed_at":"2026-06-09T09:32:48.000Z","size":51,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-09T11:16:05.612Z","etag":null,"topics":["browser-engine","cloudflare-bypass","css-selectors","html-parser","no-std","rust","web-scraping"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suhteevah.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-02T17:07:38.000Z","updated_at":"2026-06-09T09:46:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/suhteevah/wraith-dom","commit_stats":null,"previous_names":["suhteevah/wraith-dom"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/suhteevah/wraith-dom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhteevah%2Fwraith-dom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhteevah%2Fwraith-dom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhteevah%2Fwraith-dom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhteevah%2Fwraith-dom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suhteevah","download_url":"https://codeload.github.com/suhteevah/wraith-dom/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhteevah%2Fwraith-dom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34313638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["browser-engine","cloudflare-bypass","css-selectors","html-parser","no-std","rust","web-scraping"],"created_at":"2026-06-14T08:05:40.761Z","updated_at":"2026-06-14T08:05:41.611Z","avatar_url":"https://github.com/suhteevah.png","language":"Rust","funding_links":["https://www.paypal.me/baal_hosting","https://paypal.me/baal_hosting"],"categories":[],"sub_categories":[],"readme":"# wraith-dom\n\n[![no_std](https://img.shields.io/badge/no__std-compatible-brightgreen)](https://doc.rust-lang.org/reference/names/preludes.html#the-no_std-attribute)\n[![License: MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue)](LICENSE-MIT)\n\nA minimal `#![no_std]` HTML parser with CSS selectors and Cloudflare challenge solver.\n\nDesigned for environments without the standard library: bare-metal systems, WebAssembly, embedded devices, and anywhere you need lightweight HTML processing without pulling in a full browser engine.\n\n## Features\n\n- **HTML parsing** -- tokenizer and tree builder producing a flat node arena with parent/child indices\n- **CSS selectors** -- tag, id, class, attribute presence/value, descendant combinators, comma-separated alternatives\n- **Form detection** -- extract all forms and inputs; heuristic login/OAuth form finder\n- **Text extraction** -- visible text (skipping script/style), page title, and link extraction\n- **Cloudflare IUAM bypass** (optional, behind `cloudflare` feature) -- detect and solve Cloudflare \"Under Attack Mode\" challenge pages via [js-lite](https://github.com/suhteevah/js-lite)\n\n## Usage\n\nAdd to your `Cargo.toml`:\n\n```toml\n[dependencies]\nwraith-dom = \"0.1\"\n```\n\nTo enable Cloudflare challenge solving:\n\n```toml\n[dependencies]\nwraith-dom = { version = \"0.1\", features = [\"cloudflare\"] }\n```\n\n### Parse HTML and query elements\n\n```rust\nuse wraith_dom::{parse, Selector, select};\n\nlet doc = parse(\"\u003chtml\u003e\u003cbody\u003e\u003cp class=\\\"intro\\\"\u003eHello\u003c/p\u003e\u003cp\u003eWorld\u003c/p\u003e\u003c/body\u003e\u003c/html\u003e\");\n\n// Select by tag\nlet sel = Selector::parse(\"p\").unwrap();\nlet matches = select(\u0026doc, \u0026sel);\nassert_eq!(matches.len(), 2);\n\n// Select by class\nlet sel = Selector::parse(\".intro\").unwrap();\nlet matches = select(\u0026doc, \u0026sel);\nassert_eq!(matches.len(), 1);\n\n// Get text content\nlet text = doc.inner_text(matches[0]);\nassert_eq!(text, \"Hello\");\n```\n\n### Extract forms\n\n```rust\nuse wraith_dom::{parse, find_forms, find_login_form};\n\nlet doc = parse(r#\"\n    \u003cform action=\"/login\" method=\"post\"\u003e\n        \u003cinput type=\"email\" name=\"user\"\u003e\n        \u003cinput type=\"password\" name=\"pass\"\u003e\n        \u003cbutton type=\"submit\"\u003eSign In\u003c/button\u003e\n    \u003c/form\u003e\n\"#);\n\nlet forms = find_forms(\u0026doc);\nassert_eq!(forms.len(), 1);\nassert_eq!(forms[0].action, \"/login\");\nassert_eq!(forms[0].method, \"POST\");\n\n// Heuristic login form detection\nlet login = find_login_form(\u0026doc).unwrap();\nassert!(login.inputs.iter().any(|i| i.input_type == \"password\"));\n```\n\n### Extract text and links\n\n```rust\nuse wraith_dom::{parse, extract_text, extract_title, extract_links};\n\nlet doc = parse(r#\"\n    \u003chtml\u003e\n    \u003chead\u003e\u003ctitle\u003eMy Page\u003c/title\u003e\u003c/head\u003e\n    \u003cbody\u003e\n        \u003ch1\u003eWelcome\u003c/h1\u003e\n        \u003cp\u003eVisit \u003ca href=\"https://example.com\"\u003eExample\u003c/a\u003e\u003c/p\u003e\n        \u003cscript\u003evar x = 1;\u003c/script\u003e\n    \u003c/body\u003e\n    \u003c/html\u003e\n\"#);\n\nlet title = extract_title(\u0026doc);\nassert_eq!(title, Some(\"My Page\".into()));\n\nlet text = extract_text(\u0026doc);\nassert!(text.contains(\"Welcome\"));\nassert!(!text.contains(\"var x\")); // scripts are excluded\n\nlet links = extract_links(\u0026doc);\nassert_eq!(links[0].0, \"https://example.com\");\nassert_eq!(links[0].1, \"Example\");\n```\n\n### CSS selector syntax\n\n| Pattern | Matches |\n|---------|---------|\n| `p` | All `\u003cp\u003e` elements |\n| `#main` | Element with `id=\"main\"` |\n| `.active` | Elements with class `active` |\n| `[type]` | Elements with a `type` attribute |\n| `[type=\"email\"]` | Elements where `type=\"email\"` |\n| `form input` | `\u003cinput\u003e` elements inside a `\u003cform\u003e` (descendant) |\n| `input, select` | `\u003cinput\u003e` or `\u003cselect\u003e` elements |\n| `button.submit` | `\u003cbutton\u003e` elements with class `submit` |\n| `input[type=\"email\"]` | `\u003cinput\u003e` elements where `type=\"email\"` |\n\n## no_std\n\nThis crate is `#![no_std]` and requires only `alloc`. It has no dependencies beyond `log` (for optional debug logging). The `cloudflare` feature adds a dependency on `js-lite` for JavaScript evaluation.\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n## Support This Project\n\nIf you find this project useful, consider buying me a coffee! Your support helps me keep building and sharing open-source tools.\n\n[![Donate via PayPal](https://img.shields.io/badge/Donate-PayPal-blue.svg?logo=paypal)](https://www.paypal.me/baal_hosting)\n\n**PayPal:** [baal_hosting@live.com](https://paypal.me/baal_hosting)\n\nEvery donation, no matter how small, is greatly appreciated and motivates continued development. Thank you!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhteevah%2Fwraith-dom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuhteevah%2Fwraith-dom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhteevah%2Fwraith-dom/lists"}