{"id":18534572,"url":"https://github.com/lulurun/kick-off-crawling","last_synced_at":"2026-05-01T04:38:35.136Z","repository":{"id":57218221,"uuid":"50901570","full_name":"lulurun/kick-off-crawling","owner":"lulurun","description":"make web scraping easy","archived":false,"fork":false,"pushed_at":"2019-04-03T02:51:27.000Z","size":100,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T08:50:50.106Z","etag":null,"topics":["crawler","nodejs","scraper"],"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/lulurun.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":"2016-02-02T07:10:14.000Z","updated_at":"2019-04-03T02:51:06.000Z","dependencies_parsed_at":"2022-08-28T21:40:52.032Z","dependency_job_id":null,"html_url":"https://github.com/lulurun/kick-off-crawling","commit_stats":null,"previous_names":["lulurun/earthworm"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lulurun%2Fkick-off-crawling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lulurun%2Fkick-off-crawling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lulurun%2Fkick-off-crawling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lulurun%2Fkick-off-crawling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lulurun","download_url":"https://codeload.github.com/lulurun/kick-off-crawling/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254248505,"owners_count":22039008,"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":["crawler","nodejs","scraper"],"created_at":"2024-11-06T19:16:12.587Z","updated_at":"2026-05-01T04:38:30.104Z","avatar_url":"https://github.com/lulurun.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Kick-off-crawling\nprovides simple API/structure for developers to create scrapers and connect those scrapers together to achieve complicated data mining jobs.\n\nKick-off-crawling is made possible by below powerful libraries\n* [`request`](https://github.com/request/request), [`request-promise`](https://github.com/request/request-promise) for http request\n* [`puppeteer`](https://github.com/GoogleChrome/puppeteer) for making http request getting js generated html page\n* [`cheerio`](https://github.com/cheeriojs/cheerio) for translating html text to dom objects\n* [`async`](https://github.com/caolan/async) for scheduling scraping tasks\n* [`html-minifier`](https://github.com/kangax/html-minifier) for minifying html in order to get stable scraping result\n\n# Overview\n\nKick-off-crawling exposes a `Scraper` class and a `kickoff` function.\n\n`Scraper`s are self-managed:\n* scrape data and urls from a DOM object parsed by cheerio.\n* post the data to developer defined function\n* pass the url to next scraper\n\n`kickoff` takes a url and a scraper, kicks off the crawling process.\nDuring the crawling process, new scrapers (scraping job) will be generated and scheduled by `kickoff` function. The crawling process stops when there is no more scraping job.\n\n# Qucik start \u0026 Running the Examples\n\n```\n$ cd ${REPO_PATH}\n$ npm install\n$ cd examples\n$ node google.js # getting top 30 search results\n$ node amazon.js # getting top 5 apps from Amazon Appstore\n```\n\n# Usage\n\n_Working example source code: [examples/amazon.js](https://github.com/lulurun/kick-off-crawling/blob/master/examples/amazon.js)_\n\nHere is an example for getting app info from Amazon Appstore.\n\n### 1. Define your scrapers\n\nWe need to define 2 Scrapers for completing the task\n1. `BrowseNodeScraper` for getting list of app detail pages.\n2. `DetailPageScraper` for getting app into (title, stars, version) from each detail page.\n\n##### Scraping app list\n\n```\nclass BrowseNodeScraper extends Scraper {\n  scrape($, emitter) {\n    $('#mainResults .s-item-container').slice(0, 5).each((i, x) =\u003e {\n      const detailPageUrl = $(x).find('.s-access-detail-page').attr('href');\n      emitter.emitJob(detailPageUrl, new DetailPageScraper()); // \u003c-- New scraping job\n    });\n  }\n}\n```\n\n##### Scraping the detail page\n\n```\nclass DetailPageScraper extends Scraper {\n  getVersion($) {\n    let version = '';\n    $('#mas-technical-details .masrw-content-row .a-section').each((ii, xx) =\u003e {\n      const text = $(xx).text();\n      const re = /バージョン:\\s+(.+)/;\n      const matched = re.exec(text);\n      if (matched) {\n        [, version] = matched;\n      }\n    });\n    return version;\n  }\n\n  scrape($, emitter) {\n    const item = {\n      title: $('#btAsinTitle').text(),\n      star: $('.a-icon-star .a-icon-alt').eq(0).text().replace('5つ星のうち ', ''),\n      version: this.getVersion($),\n    };\n    emitter.emitItem(item); // \u003c-- the emitted item is recieved by *onItem* callback set with the `kickoff` function\n  }\n}\n```\n\n### 2. Kick off\n\n```\nkickoff(\n  'https://www.amazon.co.jp/b/?node=2386870051',\n  new BrowseNodeScraper(),\n  {\n    concurrency: 2, // \u003c-- max 2 requests at a time, default 1\n    minify: true, // \u003c-- minify html, default true\n    headless: false, // \u003c-- set true when scraping js generated page, default false\n    onItem: (item) =\u003e { // \u003c-- the item is emitted from scraper\n      console.log(item);\n    },\n    onDone: () =\u003e { // \u003c-- this is called when there is no more scraping task, optional\n      console.log('done');\n    },\n  },\n);\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flulurun%2Fkick-off-crawling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flulurun%2Fkick-off-crawling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flulurun%2Fkick-off-crawling/lists"}