{"id":24568897,"url":"https://github.com/bitliner/generator-html-parser","last_synced_at":"2025-06-22T04:02:59.145Z","repository":{"id":22002939,"uuid":"25328071","full_name":"bitliner/generator-html-parser","owner":"bitliner","description":"Generate the basic structure of an html parser to be used for scraping purpose","archived":false,"fork":false,"pushed_at":"2018-08-05T18:07:15.000Z","size":64,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-19T16:01:41.041Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/bitliner.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}},"created_at":"2014-10-16T23:53:01.000Z","updated_at":"2023-03-08T03:10:01.000Z","dependencies_parsed_at":"2022-07-17T12:00:30.834Z","dependency_job_id":null,"html_url":"https://github.com/bitliner/generator-html-parser","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/bitliner/generator-html-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitliner%2Fgenerator-html-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitliner%2Fgenerator-html-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitliner%2Fgenerator-html-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitliner%2Fgenerator-html-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitliner","download_url":"https://codeload.github.com/bitliner/generator-html-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitliner%2Fgenerator-html-parser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260816482,"owners_count":23067313,"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":"2025-01-23T14:55:40.992Z","updated_at":"2025-06-22T04:02:54.105Z","avatar_url":"https://github.com/bitliner.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# generator-html-parser \n\nA generator for [Yeoman](http://yeoman.io).\n\nIt generates the basic structure of an html parser in node.js.\n\nUseful if you are doing scraping with node.js. \n\n\n## Getting Started\n\n\n\n### How to install it\n\nTo install generator-html-parser from npm, run:\n\n```\n$ npm install -g generator-html-parser\n```\n\n\n### How to use it\n\n1. `mkdir facebook-html-parser \u0026\u0026 cd $_`\n2. `yo html-parser`\n\nThat's it!\n\n\n### How to customize it to parse any html string you need\n\nThe main file is `\u003csite-name\u003e-html-parser.js`.\n\nIt contains two methods\n\n1. `parse(html,url)`: it receives as input the html (string) to parse and an url (string), useful if you need to resolve some relative url with the node module *Url* (already imported)\n2. `getNextPages(html,url)`:  to get the urls of next pages to surf. Usually useful when you are scraping a list of pages. Still, it takes as input the html (string) to parse, and the url (string) to resolve eventually urls extracted from the html.\n\n### Test\n\nThe generated code contains code for testing as well. \nHave a look at the folder `test/`\n\n### Details of implementation\n\nIt is based on [cheerio](https://www.npmjs.org/package/cheerio) to parse the html.\n\nCheerio is like jQuery, but faster.\n\n\n\n```\n$ = cheerio.load(html);\n\n$('.item').each(function() {\n    var el=$(this);\n\tresult.push(el.text());\n})\n\n``` \n\n\n## License\n\n[MIT License](http://en.wikipedia.org/wiki/MIT_License)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitliner%2Fgenerator-html-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitliner%2Fgenerator-html-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitliner%2Fgenerator-html-parser/lists"}