Skip to content

Commit

Permalink
document the new behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
kmike committed Oct 18, 2023
1 parent 60e2265 commit 7f15a9c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,18 @@ in ``settings.py``::

ZYTE_API_PROVIDER_PARAMS = {"geolocation": "IE"}

When ``ZYTE_API_PROVIDER_PARAMS`` setting includes one of the Zyte API
extraction options (e.g. ``productOptions`` for ``product``), but the
final Zyte API request doesn't include the corresponding data type, the
unused options are automatically removed. So, it's safe to use
``ZYTE_API_PROVIDER_PARAMS`` to set the default options for various extraction
types, e.g.::

ZYTE_API_PROVIDER_PARAMS = {
"productOptions": {"extractFrom": "httpResponseBody"},
"productNavigationOptions": {"extractFrom": "httpResponseBody"},
}

Note that the built-in ``scrapy_poet.page_input_providers.ItemProvider`` has a
priority of 2000, so when you have page objects producing
``zyte_common_items.Product`` items you should use higher values for
Expand Down

0 comments on commit 7f15a9c

Please sign in to comment.