Skip to main content


This Script is part of the Common Scripts Pack.#

Extract regular text from the given HTML

Script Data#

Script Typepython3
Cortex XSOAR Version5.0.0


Argument NameDescription
htmlThe HTML to strip tags from.
html_tagSpecify the HTML tag to extract the text from within.
allow_body_fallbackAllow using the input HTML as a fallback for the body, if no body tag is found. This only applies, if html_tag is set to body.
replace_line_breaksReplace `br` in `html` with linebreaks in the output.
trim_resultTrim the extracted result. When set to true, leading and trailing whitespaces are removed and blocks of more than 3 consecutive whitespaces are collapsed to two.
output_to_contextStore the extracted text in context.


TextFromHTMLThe Text extracted from the given HTML.string

Script Examples#

Example command#

!TextFromHTML html="<!DOCTYPE html><html><body><h1>This is heading 1</h1></body></html>"

Context Example#


Human Readable Output#

This is heading 1