Back to Changedetection Io

Include Subtract

changedetectionio/templates/edit/include_subtract.html

0.55.32.6 KB
Original Source

{% set field = render_field(form.include_filters, rows=5, placeholder=has_tag_filters_extra+"#example xpath://body/div/span[contains(@class, 'example-class')]", class="m-d") %} {{ field }} {% if '/text()' in field %} {{ _('Note!: //text() function does not work where the contains ') }}
{% endif %} {{ _('One CSS, xPath 1 & 2, JSON Path/JQ selector per line, any rules that matches will be used.') | safe }}
{{ _('Show advanced help and tips') }}

  • CSS - {{ _('Limit text to this CSS rule, only text matching this CSS rule is included.') }}

  • JSON - Limit text to this JSON rule, using either JSONPath or jq (if installed).

    • JSONPath: {{ _('Prefix with json:, use json:$ to force re-formatting if required,') | safe }} {{ _('test your JSONPath here') }}. {% if jq_support %} - jq: Prefix with jq: and test your jq here. Using jq allows for complex filtering and processing of JSON data with built-in functions, regex, filtering, and more. See examples and documentation here. {{ _('Prefix jqraw: outputs the results as text instead of a JSON list.') | safe }} {% else %} - {{ _('jq support not installed') }} {% endif %}
  • XPath - {{ _('Limit text to this XPath rule, simply start with a forward-slash. To specify XPath to be used explicitly or the XPath rule starts with an XPath function: Prefix with xpath:') | safe }}

    • {{ _('Example') }}: //*[contains(@class, 'sametext')] or xpath:count(//*[contains(@class, 'sametext')]), {{ _('test your XPath here') }}
    • {{ _('Example') }}: {{ _('Get all titles from an RSS feed //title/text()') | safe }}
    • {{ _('To use XPath1.0: Prefix with xpath1:') | safe }}
  • Please be sure that you thoroughly understand how to write CSS, JSONPath, XPath{% if jq_support %}, or jq selector{%endif%} rules before filing an issue on GitHub! {{ _('here for more CSS selector help') }}.

{{ render_field(form.subtractive_selectors, rows=5, placeholder=has_tag_filters_extra+"header footer nav .stockticker //*[contains(text(), 'Advertisement')]") }}

  • {{ _('Remove HTML element(s) by CSS and XPath selectors before text conversion.') }}
  • {{ _("Don't paste HTML here, use only CSS and XPath selectors") }}
  • {{ _('Add multiple elements, CSS or XPath selectors per line to ignore multiple parts of the HTML.') }}