{"id":22814494,"url":"https://github.com/68publishers/crawler","last_synced_at":"2025-04-22T18:41:12.259Z","repository":{"id":169264516,"uuid":"622063726","full_name":"68publishers/crawler","owner":"68publishers","description":":spider_web: Awesome scenario based crawler","archived":false,"fork":false,"pushed_at":"2024-03-06T23:58:01.000Z","size":1812,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-20T23:06:27.126Z","etag":null,"topics":["crawlee","crawler","crawling","node","nodejs","scraper","scraping"],"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/68publishers.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-04-01T02:43:42.000Z","updated_at":"2024-04-17T19:34:29.000Z","dependencies_parsed_at":"2023-11-13T20:38:36.640Z","dependency_job_id":null,"html_url":"https://github.com/68publishers/crawler","commit_stats":null,"previous_names":["68publishers/cmp-crawler"],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/68publishers%2Fcrawler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/68publishers%2Fcrawler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/68publishers%2Fcrawler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/68publishers%2Fcrawler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/68publishers","download_url":"https://codeload.github.com/68publishers/crawler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229388360,"owners_count":18065252,"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":["crawlee","crawler","crawling","node","nodejs","scraper","scraping"],"created_at":"2024-12-12T13:09:07.683Z","updated_at":"2024-12-12T13:09:08.324Z","avatar_url":"https://github.com/68publishers.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\" style=\"text-align: center; margin-bottom: 50px\"\u003e\n\u003cimg src=\"public/images/logo.svg\" alt=\"Crawler Logo\" align=\"center\" width=\"200\"\u003e\n\u003ch1 align=\"center\"\u003eCrawler\u003c/h1\u003e\n\u003cp\u003eScenario-based crawler written in Node.js\u003c/p\u003e\n\u003c/div\u003e\n\n## Table of Contents\n\n* [About](#about)\n* [Development setup](#development-setup)\n* [Production setup](#production-setup)\n* [Environment variables](#environment-variables)\n* [Rest API and Queues board](#rest-api-and-queues-board)\n* [Working with scenarios](#working-with-scenarios)\n* [Working with scenario schedulers](#working-with-scenario-schedulers)\n* [Tutorial: Creating the fist scenario](#tutorial-creating-the-first-scenario)\n* [Integrations](#integrations)\n* [License](#license)\n\n## About\n\nCrawler is a standalone application written in Node.js built on top of [Express.js](https://github.com/expressjs/express), [Crawlee](https://github.com/apify/crawlee), [Puppeteer](https://github.com/puppeteer/puppeteer) and [BullMQ](https://github.com/taskforcesh/bullmq), allowing you to crawl data from web pages by defining scenarios. This is all controlled through the Rest API.\n\n![Crawler admin](docs/images/main.png)\n\n## Development setup\n\n### Prerequisites\n\n- Docker compose\n- Make\n\n### Installation\n\n```sh\n$ git clone https://github.com/68publishers/crawler.git crawler\n$ cd crawler\n$ make init\n```\n\n### Creating a user\n\nHTTP Basic authorization is required for API access and administration. Here we need to create a user to access the application.\n\n```sh\n$ docker exec -it crawler-app npm run user:create\n```\n\n## Production setup\n\n### Prerequisites\n\n- Docker\n- Postgres `\u003e=14.6`\n- Redis `\u003e=7`\n\nFor production use, the following Redis settings must be made:\n\n1. Configuring persistence with `Append-only-file` strategy - https://redis.io/docs/management/persistence/#aof-advantages\n1. Set `Max memory policy` to `noeviction` - https://redis.io/docs/reference/eviction/#eviction-policies\n\n### Installation\n\nFirstly, you need to run the database migrations with the following command:\n\n```sh\n$ docker run \\\n    --network \u003cNETWORK\u003e \\\n    -e DB_URL=postgres://\u003cUSER\u003e:\u003cPASSWORD\u003e@\u003cHOSTNAME\u003e:\u003cPORT\u003e/\u003cDB_NAME\u003e \\\n    --entrypoint '/bin/sh' \\\n    -it \\\n    --rm \\\n    68publishers/crawler:latest \\\n    -c 'npm run migrations:up'\n```\n\nThen download the `seccomp` file, which is required to run chrome:\n\n```sh\n$ curl -C - -O https://raw.githubusercontent.com/68publishers/crawler/main/.docker/chrome/chrome.json\n```\n\nAnd run the application:\n\n```sh\n$ docker run \\\n    -- init \\\n    --network \u003cNETWORK\u003e \\\n    -e APP_URL=\u003cAPPLICATION_URL\u003e \\\n    -e DB_URL=postgres://\u003cUSER\u003e:\u003cPASSWORD\u003e@\u003cHOSTNAME\u003e:\u003cPORT\u003e/\u003cDB_NAME\u003e \\\n    -e REDIS_HOST=\u003cHOSTNAME\u003e \\\n    -e REDIS_PORT=\u003cPORT\u003e \\\n    -e REDIS_AUTH=\u003cPASSWORD\u003e \\\n    -p 3000:3000 \\\n    --security-opt seccomp=$(pwd)/chrome.json \\\n    -d \\\n    --name 68publishers_crawler \\\n    68publishers/crawler:latest\n```\n\n### Creating a user\n\nHTTP Basic authorization is required for API access and administration. Here we need to create a user to access the application.\n\n```sh\n$ docker exec -it 68publishers_crawler npm run user:create\n```\n\n## Environment variables\n\n| Name                | Required | Default                     | Description                                                                                                             |\n|---------------------|----------|-----------------------------|-------------------------------------------------------------------------------------------------------------------------|\n| APP_URL             | yes      | -                           | Full origin of the application e.g. `https://www.example.com`. The variable is used to create links to screenshots etc. |\n| APP_PORT            | no       | `3000`                      | Port to which the application listens                                                                                   |\n| DB_URL              | yes      | -                           | Connection string to postgres database e.g. postgres://root:root@localhost:5432/crawler                                 |\n| REDIS_HOST          | yes      | -                           | Redis hostname                                                                                                          |\n| REDIS_PORT          | yes      | -                           | Redis port                                                                                                              |\n| REDIS_AUTH          | no       | -                           | Optional redis password                                                                                                 |\n| REDIS_DB            | no       | `0`                         | Redis database number                                                                                                   |\n| WORKER_PROCESSES    | no       | `5`                         | Number of workers that process the queue of running scenarios                                                           |\n| CRAWLEE_STORAGE_DIR | no       | `./var/crawlee`             | Directory where crawler stores runtime data                                                                             |\n| CHROME_PATH         | no       | `/usr/bin/chromium-browser` | Path to Chromium executable file                                                                                        |\n| SENTRY_DSN          | no       | -                           | Logging into the Sentry is enabled if the variable is passed                                                            |\n| SENTRY_SERVER_NAME  | no       | `crawler`                   | Server name that is passed into the Sentry logger                                                                       |\n\n## Rest API and Queues board\n\nThe specification of the Rest API (Swagger UI) can be found at endpoint `/api-docs`. Usually `http://localhost:3000/api-docs` in case of development setup. You can try to call all endpoints here.\n\nAlternatively, the specification can be viewed [online](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/68publishers/crawler/main/public/openapi.json).\n\nBullBoard is located at `/admin/queues`. Here you can see all the scenarios that are currently running or have already run.\n\n## Working with scenarios\n\n@todo\n\n## Working with scenario schedulers\n\n@todo\n\n## Tutorial: Creating the first scenario\n\n@todo\n\n## Integrations\n\n- PHP Client for Crawler's API - [68publishers/crawler-client-php](https://github.com/68publishers/crawler-client-php)\n\n## License\n\nThe package is distributed under the MIT License. See [LICENSE](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F68publishers%2Fcrawler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F68publishers%2Fcrawler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F68publishers%2Fcrawler/lists"}