parseHtml

Parses HTML tags and invokes handlers based on criteria.

Parses HTML tags and invokes handlers based on criteria.

PropertyTypeDescription
onEmbeddedResourceBuilderHandler firing upon reference to other resource, e.g. image, stylesheet…
onTagAttributeBuilder<no description>

onEmbeddedResource

Handles <img src="…">, <link href="…">, <embed src="…">, <frame src="…">, <iframe src="…">, <object data="…"> and <script src="…">.

Does not handle <source src="…"> or <track src="…"> because browser would choose only one of the options.

PropertyTypeDescription
fetchResourceBuilderAutomatically download referenced resource.
ignoreExternalbooleanIgnore resources hosted on servers that are not covered in the http section.
processorProcessor.BuilderAdd one or more processors.
processor (alternative)Processor.BuilderCustom processor invoked pointing to attribute data - e.g. in case of <img> tag the processor gets contents of the src attribute.

onEmbeddedResource.fetchResource

Automates download of embedded resources.

PropertyTypeDescription
concurrencyintMaximum number of resources fetched concurrently. Default is 8.
maxResourcesintMaximum number of resources that can be fetched.
metric<list of strings>Metrics selector for downloaded resources.
onCompletionAction.BuilderAction performed when the download of all resources completes.

onEmbeddedResource.fetchResource.metric

Metrics selector for downloaded resources.

PropertyTypeDescription
<list of strings><list of strings>Allows categorizing request statistics into metrics based on the request path. The expressions are evaluated in the order as provided in the list. Use one of:
  • regexp -> replacement, e.g. ([^?])(?.)? -> $1 to drop the query part.
  • regexp (don’t do any replaces and use the full path), e.g. .*.jpg
  • -> name (metric applied if none of the previous expressions match).

onTagAttribute

PropertyTypeDescription
attributeStringName of the attribute in this element you want to process, e.g. action
formatenumConversion to apply on the matching parts with ’toVar’ or ’toArray’ shortcuts.
Options:
  • BYTEBUFStore the buffer directly. Beware that this may cause memory leaks!
  • BYTESStore data as byte array.
  • STRINGInterprets the bytes as UTF-8 string.
processorProcessor.BuilderAdd one or more processors.
tagStringName of the tag this handler should look for, e.g. form
toArrayStringShortcut to store selected parts in an array in the session. Must follow the pattern variable[maxSize]
toVarStringShortcut to store first match in given variable. Further matches are ignored.

Last modified September 2, 2024: docs: fix quickstart links (245525b)