{"id":25189683,"url":"https://github.com/patrickschababerle/schabbi-webscraper","last_synced_at":"2025-04-04T11:22:57.334Z","repository":{"id":42659416,"uuid":"350776075","full_name":"patrickschababerle/schabbi-webscraper","owner":"patrickschababerle","description":"Small and easy to use NodeJS webcrawler project. Returns basic information about the crawled sites.","archived":false,"fork":false,"pushed_at":"2025-03-28T22:19:06.000Z","size":1115,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T10:38:31.289Z","etag":null,"topics":["crawler","puppeteer","scraper","scraping","web-crawler"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/patrickschababerle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2021-03-23T16:09:15.000Z","updated_at":"2024-08-07T13:23:38.000Z","dependencies_parsed_at":"2024-08-07T15:22:39.915Z","dependency_job_id":null,"html_url":"https://github.com/patrickschababerle/schabbi-webscraper","commit_stats":{"total_commits":98,"total_committers":3,"mean_commits":"32.666666666666664","dds":0.3877551020408163,"last_synced_commit":"e778cd9900d62acb365caef7ee1503f91267d21c"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickschababerle%2Fschabbi-webscraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickschababerle%2Fschabbi-webscraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickschababerle%2Fschabbi-webscraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickschababerle%2Fschabbi-webscraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrickschababerle","download_url":"https://codeload.github.com/patrickschababerle/schabbi-webscraper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247167065,"owners_count":20894855,"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","puppeteer","scraper","scraping","web-crawler"],"created_at":"2025-02-09T21:16:42.117Z","updated_at":"2025-04-04T11:22:57.316Z","avatar_url":"https://github.com/patrickschababerle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"/schabbi_teaser.png\" alt=\"Schabbi Webscraper\"\u003e\u003c/p\u003e\n\u003chr\u003e\n\u003c!-- [START badges] --\u003e\n\n[![Build Status](https://travis-ci.com/PatrickSchababerle/schabbi-webscraper.svg?token=x3Xxx6fmnZtByDoY9d4v\u0026branch=master)](https://travis-ci.com/PatrickSchababerle/schabbi-webscraper)\n[![npm puppeteer package](https://img.shields.io/npm/v/schabbi-webscraper)](https://npmjs.org/package/schabbi-webscraper)\n[![Package Quality](https://packagequality.com/shield/schabbi-webscraper.svg)](https://packagequality.com/#?package=schabbi-webscraper)\n![Downloads](https://img.shields.io/npm/dw/schabbi-webscraper)\n\n\n\u003c!-- [END badges] --\u003e\n\nLightweight and easy to use webcrawler.\n\n## Features\n\n- Fast and reliable\n- Supports custom page handling\n- Result contains also all cookies\n- Accepts all puppeteer parameters\n\n## Requirements\n\n - NodeJS v15.*\n\n## Installation\n\n### via NPM\n```bash\n$ npm i schabbi-webscraper\n```\n### via Github\n```bash\n$ git clone https://github.com/PatrickSchababerle/schabbi-webscraper\n$ npm install\n```\n## Usage\n\n#### Standard use case\n```js\nconst  Schabbi = require('schabbi-webscraper');\nconst  Crawler = new Schabbi();      \n\nCrawler.setUrl('https://www.example.com').crawl();\n```\n#### With custom option parameters\n```js\nconst  Schabbi = require('schabbi-webscraper');\nconst  Crawler = new Schabbi();\n\nCrawler.setUrl('https://www.example.com').withOptions({\n    includeExternalLinks :  true,\n    userAgent :  \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36\",\n    authentication : {\n        username : 'Testuser',\n        password : 'Test'\n    }\n}).crawl();\n```\nYou can decide which crawled links are added to the queue by using the queue option. F.e. to crawl only pages with a specific attribute, class or target:\n\n```js\nconst  Schabbi = require('schabbi-webscraper');\nconst  Crawler = new Schabbi();\n\nCrawler.setUrl('https://www.digitalsterne.de').withOptions({\n    queue : {\n        pattern : 'a[href*=\"/2021/05/06\"]'\n    }\n}).crawl();\n```\nYou can also decide if parameters are ignored when adding urls to the queue:\n\n```js\nconst  Schabbi = require('schabbi-webscraper');\nconst  Crawler = new Schabbi();\n\nCrawler.setUrl('https://www.digitalsterne.de').withOptions({\n    ignoreUrlParameter : true\n}).crawl();\n```\n\n#### Work with the crawled pages while the're beeing processed\n\nWith custom functions you can perform actions on each crawled page. The results will be pushed into the final results.\n```js\nconst  Schabbi = require('schabbi-webscraper');\nconst  Crawler = new Schabbi();\n\nCrawler.setUrl('https://digitalsterne.de').eachPage(async (page) =\u003e {\n    const links = await page.$$eval('a', as =\u003e as.map(a =\u003e a.href));\n    return links;\n}).crawl().then((result) =\u003e {\n    console.log(result);\n});\n```\n#### Further work with result\n\nSchabbi is returning a promise which will be resolved as soon as the crawl has finished:\n```js\nconst  Schabbi = require('schabbi-webscraper');\nconst  Crawler = new Schabbi();\n\nCrawler.setUrl('https://www.example.com').crawl().then((result) =\u003e {\n    console.log(result);\n});\n```\n## Methods\n\n| Method | Description |\n|--|--|\n| withOptions( Object ) | Set custom options for the crawler |\n| setUrl( String ) | Set initial url |\n| crawl() | Start the crawling |\n\n\n## Configuration\n\n| Option | Description | Type |\n|--|--|--|\n| includeExternalLinks | Determine if Schabbi should output external links in the results | BOOLEAN |\n| userAgent | Use a custom User Agent for crawling | STRING |\n| browser | Settings for Puppeteer. All Puppeteer browser launch arguments are accepted | OBJECT |\n| queue | Set custom pattern for evaluation of links inside crawled pages. | OBJECT |\n\nVisit the examples for detailed information on how to use options properly.\n\n\n## About this project\n\nThis is one of my first projects on github to be available for you all out there. Please feel free to provide feedback!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickschababerle%2Fschabbi-webscraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickschababerle%2Fschabbi-webscraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickschababerle%2Fschabbi-webscraper/lists"}