Remove Tags

The Remove Tags action removes tags from the found tags that match the specified criteria, based on two sets of rules.

Set-up

The Remove Tags action is configured by defining a set of rules for tags to remove, and a set of rules to except tags from the deletion rules.

Adding and removing rules from the lists

To add a rule to one of the two lists, click '+' below the list. Removing a rule is done by selecting the rule in the list, and clicking '-' below. To reorder the rules, use the arrows below the list. After adding a rule, you can edit it by using the 'edit' button below the list.

Note Defining no rules in the list of remove rules removes all tags that are not matched by any of the except rules.
Tag matching rule configuration

On the tag matcher rule editor that opens upon clicking '+' or 'edit' below a list, you can see a choice of three different methods for matching the tags to be either removed or excluded from removal.

Select one of the following options from the Tag Matcher list.

  • Tags with this name will match all tags with the exact name written in 'Tag Name'.
  • Tags with this name and attribute will match all tags with the exact name written in 'Tag Name' and matching the criteria for the attributes.
  • Tags matching this pattern will match a regular expression against the start tags including their attributes (everything between < and >). Tag matching patterns can be inverted to match all tags, that does not match the pattern.
  • Texts matching this pattern will match a regular expression against the texts inside the found tags. If the regular expression is left empty, it will match all texts.
  • Comments will match all comments.
Properties for the tag matching methods
The 'include children' option

Checking the 'include children' checkbox (default) means including the children for this rule. For remove rules, this means not only removing the tag (and its corresponding end tag) but also removing all contents of the tag. For except rules, this means keeping also the children (even if any of the children matches a remove rule).

This option is strongest for the except rules. That means, if a tag is matched by one of the remove rules, which is set to include its children, if any of the child tags of that tag matches one of the except rules, the child tag is kept (including its children).

Options for the 'Tags with this name' matching method
Tag Name

Specifies the exact name of the tags matched by this rule.

Options for the 'Tags with this name and attribute' matching method
Tag Name

Specifies the exact name of the tags matched by this rule. This option can be left blank, if tags should only be matched on the attribute criteria.

Attribute Name

Specifies the exact name of the attribute to match.

Attribute Value Pattern

Specifies a pattern that must match the attribute value of the specified attribute.

Options for the 'Tags matching this pattern' matching method
Tag Name

Specifies the exact name of the tags matched by this rule.

Invert Pattern

Select this option to make the rule match all tags, that do not conform to this pattern.

Options for the 'Texts matching this pattern' matching method.
Pattern

Specifies a pattern that must match the text. Leaving this pattern blank, will make it match all texts.

Options for the 'Comments' matching method.

This method has no options, and will always match all comments. Use tag finders to point out specific comments to be deleted.

Continue when
Add a wait criterion for the step. If you have several wait criteria, execution stops when any wait criterion is met. You can have several met wait criteria such as if you are waiting for two HTML elements that appear on the same load, or if you are waiting for an element on the main frame, and Initial Page Load Completes is set. For more information, see Use Wait Criteria.