Skip to content

Commit

Permalink
Merge pull request #70 from zytedata/custom-attrs-direct-item
Browse files Browse the repository at this point in the history
Add the custom attrs meta to direct_item start requests.
  • Loading branch information
wRAR authored Oct 2, 2024
2 parents 9fe01af + 95afbef commit 01c8a70
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions zyte_spider_templates/spiders/ecommerce.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,14 @@ def get_start_request(self, url):
else "productNavigation"
},
}
if (
self.args.crawl_strategy == EcommerceCrawlStrategy.direct_item
and self._custom_attrs_dep
):
meta["inject"] = [
self._custom_attrs_dep,
]

if self.args.crawl_strategy == EcommerceCrawlStrategy.full:
meta["page_params"] = {"full_domain": get_domain(url)}
elif self.args.crawl_strategy == EcommerceCrawlStrategy.automatic:
Expand Down

0 comments on commit 01c8a70

Please sign in to comment.