{"id":17501906,"url":"https://github.com/calvinmclean/html_parser","last_synced_at":"2026-04-09T01:03:48.930Z","repository":{"id":252488578,"uuid":"840596275","full_name":"calvinmclean/html_parser","owner":"calvinmclean","description":"a simple HTML parser using Gleam","archived":false,"fork":false,"pushed_at":"2024-11-27T22:51:27.000Z","size":38,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-05T14:38:39.059Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/calvinmclean.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-10T05:37:59.000Z","updated_at":"2025-11-14T08:53:20.000Z","dependencies_parsed_at":"2024-12-08T10:41:43.226Z","dependency_job_id":"ba12d6c4-2b2c-4409-9ae4-b339a41130bd","html_url":"https://github.com/calvinmclean/html_parser","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"ff5b574dffa6bfa729c86cfc1d04effebdac9697"},"previous_names":["calvinmclean/html_parser"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/calvinmclean/html_parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmclean%2Fhtml_parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmclean%2Fhtml_parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmclean%2Fhtml_parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmclean%2Fhtml_parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/calvinmclean","download_url":"https://codeload.github.com/calvinmclean/html_parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmclean%2Fhtml_parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31580509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-10-19T20:16:32.437Z","updated_at":"2026-04-09T01:03:48.904Z","avatar_url":"https://github.com/calvinmclean.png","language":"HTML","readme":"# html_parser\n\n[![Package Version](https://img.shields.io/hexpm/v/html_parser)](https://hex.pm/packages/html_parser)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/html_parser/)\n\n`html_parser` is a simple library for parsing an HTML document. Use `html_parser.as_list` to parse the document\nas List of Elements. Use `html_parser.as_tree` to create a nested structure where Elements have children.\n\n- `StartElement`: HTML opening tag, like `\u003cdiv\u003e`\n- `EndElement`: HTML closing tag, like `\u003c/div\u003e`\n- `Content`: Non-HTML parts of the document inside tags (the \"hello\" in `\u003cdiv\u003ehello\u003c/div\u003e`)\n- `Attributes`: HTML attributes inside of a tag (`href` key and value in `\u003ca href=\"github.com\"\u003e`)\n\n```sh\ngleam add html_parser@1\n```\n```gleam\nimport html_parser\n\npub fn main() {\n  \"\u003cdiv\u003e\u003cdiv class=\\\"data\\\"\u003eData!\u003c/div\u003e\u003c/div\u003e\"\n  |\u003e html_parser.as_list\n  |\u003e find_div\n  |\u003e io.debug\n}\n\n// find a starting div where class=data and the next element is Content\nfn find_div(in: List(html_parser.Element)) -\u003e String {\n  case in {\n    [] -\u003e \"Not found\"\n    [\n      html_parser.StartElement(\"div\", [html_parser.Attribute(\"class\", \"data\")], _),\n      html_parser.Content(contents),\n      ..\n    ] -\u003e contents\n    [_, ..tail] -\u003e find_div(tail)\n  }\n}\n```\n\nFurther documentation can be found at \u003chttps://hexdocs.pm/html_parser\u003e.\n\n## Development\n\n```sh\ngleam run   # Run the project\ngleam test  # Run the tests\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalvinmclean%2Fhtml_parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalvinmclean%2Fhtml_parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalvinmclean%2Fhtml_parser/lists"}