{"id":13989640,"url":"https://github.com/oscarnevarezleal/ecommerce-crawler","last_synced_at":"2026-01-16T02:28:48.947Z","repository":{"id":58835653,"uuid":"141307998","full_name":"oscarnevarezleal/ecommerce-crawler","owner":"oscarnevarezleal","description":"Parallel ecommerce crawler using Docker and Puppeter on GCP","archived":false,"fork":false,"pushed_at":"2019-03-22T01:22:51.000Z","size":39,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-29T08:39:22.315Z","etag":null,"topics":["crawler","gcp","nodejs","pubnub","puppeteer"],"latest_commit_sha":null,"homepage":"https://oscarnevarezleal.github.io/ecommerce-crawler/","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/oscarnevarezleal.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":"2018-07-17T15:21:05.000Z","updated_at":"2022-09-08T03:36:37.000Z","dependencies_parsed_at":"2022-09-08T18:31:17.981Z","dependency_job_id":null,"html_url":"https://github.com/oscarnevarezleal/ecommerce-crawler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oscarnevarezleal/ecommerce-crawler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarnevarezleal%2Fecommerce-crawler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarnevarezleal%2Fecommerce-crawler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarnevarezleal%2Fecommerce-crawler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarnevarezleal%2Fecommerce-crawler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oscarnevarezleal","download_url":"https://codeload.github.com/oscarnevarezleal/ecommerce-crawler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarnevarezleal%2Fecommerce-crawler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266483512,"owners_count":23936355,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","gcp","nodejs","pubnub","puppeteer"],"created_at":"2024-08-09T13:01:53.266Z","updated_at":"2026-01-16T02:28:48.899Z","avatar_url":"https://github.com/oscarnevarezleal.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"## Before you start\n\n- This is mostly a proof of concept and have tons of improvements to be made. It goes without saying that this is not a production-ready project.\n- Altought is very easy to port to AWS its is not planned in a near future. You can ways fork and send a PR\n- Note:  If you don’t have gcloud installed please refer to [gcloud sdk installation ](https://cloud.google.com/storage/docs/gsutil_install)\n- Note: After you configre your project in GCP, make sure you got your own ```service-key.json``` file\n- Note: if this is your first time using GCP, you need to authenticate your laptop to use GCP services by running gcloud auth login from the command line.\n\n## Overview\nThis project takes a bunch of urls and it transform them into [```Jobs```](#Jobs) , these [```Jobs```](#Jobs) are published into [Pub/Nub](https://cloud.google.com/pubsub/docs/overview) and awaits there until they´re read by the [```Worker```](#Worker).\nWhen the [```Worker```](#Worker) became aware of one Job it spawn a new crawler using [Puppeteer](https://github.com/GoogleChrome/puppeteer), after the content has been grabbed the result is persisted in [DataStore](https://cloud.google.com/datastore/docs/) and the worker moves to the next Job in line. This process is repeated as long as there are Jobs.\n\n## Usage\n\n### Environment\nThe following environment variables must be setted before testing\n- GAE_APPLICATION - the name of your GCP application\n- GOOGLE_APPLICATION_CREDENTIALS - the path to your ```service-key.json```\n\n### Steps\nFollow this steps to run your application locally\n- Clone this repository\n- Run npm install\n- Rename ```urls.sample.js``` to ```urls.js``` and include the urls you want to crawl\n- Rename ```config.sample.js``` to ```config.js``` and edit ```gcp``` and ```descriptor``` section\n\n```\n# generate the messages\nnode index.js\n# when finished run the worker\nnode src/worker.js\n```\n\n## Config\n\n### Descriptor\nDescriptor object is the backbone of this crawler, in here you specify each one of the things you want to grab from page.\n\n|Property   \t| Type  \t| Comments  \t|\n|---\t|---\t|---\t|\n|name\t| String\t|\t|\n|primary\t| Boolean\t| Wether this is a primary attribute ( think about saving process)\t|\n|required \t|  Boolean \t| If is set to true execution will stop when element is not found\n|selector \t|  Boolean \t| A valid CSS selector\n|attribute  |  String | Optional attribute to grab from selector\n|format \t|  Function\u003cString value\u003e \t| A callback to format the value grabbed\n\n### Puppeteer\nPuppeteer configuration\n\n|Property   \t| Default  \t| Comments  \t|\n|---\t|---\t|---\t|\n|waitUntil \t|  load \t| When to consider navigation succeeded, defaults to load. Given an array of event strings, navigation is considered to be successful after all events have been fired [See docs](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md)\n\n### Aggregates\nAggregation is a process that ocurrs after all elements have been grabbed.\n\n|Property   \t| Type  \t| Comments  \t|\n|---\t|---\t|---\t|\n|name\t| String\t|\t|\n|source \t|  Function\u003cObject Descriptor\u003e \t| Descriptor object contains all elements grabbed in first step\n\n## Saving strategies\n\n- Data storage GCP\n- Others [pending documentation]\n\n## Publish\n```\ndocker build -t gcr.io/$(gcloud config get-value project)/worker .\ngcloud docker -- push gcr.io/$(gcloud config get-value project)/worker\n```\n\n## Final notes\n- Finalize your cluster after workload has been finished is trongly recommended to avoid incurring on innecesary charges.\n- If you think this project suits your needs but needs a little tweak send me a message and I´d be happy to talk about it.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foscarnevarezleal%2Fecommerce-crawler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foscarnevarezleal%2Fecommerce-crawler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foscarnevarezleal%2Fecommerce-crawler/lists"}