Skip to content

Refactor product extraction to use configuration-driven approach #37

Description

@vertefra

Problem

extractAmazonProduct() and extractWalmartProduct() in utils/productExtractor.ts have identical structure but different selectors. This makes:

  • Adding new marketplaces require duplicating ~50 lines of code
  • Selector updates need changes in multiple places
  • Hard to maintain and test

Solution

Use a configuration-driven approach with marketplace configs and generic extraction functions.

See full implementation in the original review document.

Benefits

  • Eliminates ~100 lines of duplicate code
  • Adding new marketplace = just add config object
  • Easier to test and maintain
  • Centralized selector management

Priority

High

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions