1
0
Fork 0
ecommerce-exporter/ecommerce-exporter.example.yml

26 lines
1.6 KiB
YAML
Raw Permalink Normal View History

products:
# The name of the product. This will be the value of the `product_name` label in the metrics.
- name: i7-12700k
targets:
# The parser. Can be either html or json.
# html will be appropriate for sites with static pages.
# json will be appropriate for sites with dynamic pages.
- parser: html
# If using the html parser, the url to the product page
# If using the json parser, the url of the api call the page do to fetch pricing information
url: https://www.amazon.ca/Intel-i7-12700K-Desktop-Processor-Unlocked/dp/B09FXNVDBJ/
# If using the html parser, a CSS selector that match the html element containing the price of the product. If multiple html elements match, the first match will be used.
# If using the json parser, a jq style selector that match the field containing the price information. See https://stedolan.github.io/jq/manual/#Basicfilters for documentation on how to write jq style selectors.
selector: '.a-offscreen::text'
# Optional
# A regex expression that match the result of the selector and extract the price from the text.
# The match must be able to be parsed to a valid float value. If there are multiple matches, the first one will be used.
regex: '[0-9]+(\.[0-9]{2})?'
# json parser example
# - parser: json
# url: https://www.newegg.ca/product/api/ProductRealtime?ItemNumber=19-118-343&RecommendItem=&BestSellerItemList=9SIAA4YGC82324%2C9SIADGEGMY7603%2C9SIAVH1J0A6685&IsVATPrice=true
# selector: '.MainItem.UnitCost'