{"id":20278498,"url":"https://github.com/wmentor/html","last_synced_at":"2025-07-27T10:34:38.503Z","repository":{"id":57518217,"uuid":"246672418","full_name":"wmentor/html","owner":"wmentor","description":"HTML data fetcher","archived":false,"fork":false,"pushed_at":"2023-12-12T06:48:34.000Z","size":25,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T06:54:11.669Z","etag":null,"topics":["go","go-lib","go-library","golang","golang-library","html","html-parser","parser"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wmentor.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2020-03-11T20:22:48.000Z","updated_at":"2023-12-12T06:43:19.000Z","dependencies_parsed_at":"2024-06-21T03:56:04.027Z","dependency_job_id":"a0eb0061-9aa9-415c-88e2-dd65b05bc05b","html_url":"https://github.com/wmentor/html","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmentor%2Fhtml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmentor%2Fhtml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmentor%2Fhtml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmentor%2Fhtml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wmentor","download_url":"https://codeload.github.com/wmentor/html/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241768283,"owners_count":20017129,"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":["go","go-lib","go-library","golang","golang-library","html","html-parser","parser"],"created_at":"2024-11-14T13:23:46.284Z","updated_at":"2025-03-04T01:44:35.303Z","avatar_url":"https://github.com/wmentor.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTML\n\n[![Coverage Status](https://coveralls.io/repos/github/wmentor/html/badge.svg?branch=master\u0026v=1.0.3)](https://coveralls.io/github/wmentor/html?branch=master)\n[![https://goreportcard.com/report/github.com/wmentor/html](https://goreportcard.com/badge/github.com/wmentor/html)](https://goreportcard.com/report/github.com/wmentor/html)\n[![https://pkg.go.dev/github.com/wmentor/html](https://pkg.go.dev/badge/github.com/wmentor/html.svg)](https://pkg.go.dev/github.com/wmentor/html)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nSimple HTML parser and data fetcher library written on Golang under MIT License.\n\n## Require\n\n* Golang (version \u003e= 1.20)\n* golang.org/x/net\n\n## Install\n\n```\ngo get github.com/wmentor/html\n```\n\n## Usage\n\n### Fetch data from URL\n\n```golang\npackage main\n\nimport (\n  \"fmt\"\n  \"time\"\n\n  \"github.com/wmentor/html\"\n)\n\nfunc main() {\n\n  src := \"https://edition.cnn.com\"\n\n  parser := html.New()\n\n  opts := \u0026html.GetOpts{\n    Agent:\"Mozilla/5.0 (compatible; MSIE 10.0)\",\n    Timeout: time.Second*60,\n  }\n\n  parser.Get(src,opts)\n  fmt.Println( string(parser.Text()) )\n\n  parser.EachLink(func(link string) {\n    fmt.Println(\"url=\" + link)\n  } )\n\n  parser.EachImage(func(link string) {\n    fmt.Println(\"img=\" + link)\n  } )\n\n  parser.EachIframe(func(link string) {\n    fmt.Println(\"iframe=\" + link)\n  } )\n}\n```\n\n### Fetch data from file/stdin\n\n```golang\npackage main\n\nimport (\n  \"fmt\"\n  \"os\"\n\n  \"github.com/wmentor/html\"\n)\n\nfunc main() {\n\n  parser := html.New()\n\n  parser.Parse(os.Stdin) // io.Reader\n  fmt.Println( string(parser.Text()) )\n\n  parser.EachLink(func(link string) {\n    fmt.Println(\"url=\" + link)\n  } )\n\n  parser.EachImage(func(link string) {\n    fmt.Println(\"img=\" + link)\n  } )\n\n  parser.EachIframe(func(link string) {\n    fmt.Println(\"iframe=\" + link)\n  } )\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwmentor%2Fhtml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwmentor%2Fhtml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwmentor%2Fhtml/lists"}