Skip to main content

Check for Element

Checks if an HTML element exists on a page. If it does, the output will be true; otherwise, it will be false.

Category: Web Scraping & Data Extraction · Group: Web · Activity name: CheckHtmlElement

The CheckHtmlElement activity in the designer

Example

outputVariable = CheckHtmlElement("<selector>", iframeSelector="<iframeSelector>", iframeSelectors=[], timeout=5000)

Inputs

NameTypeRequiredDefaultDescription
SelectorstringYesCSS selector or XPath to identify the web element.
iFrame SelectorstringCSS selector or XPath to locate the iframe containing the target element. Leave empty if the element is not inside an iframe.
iFrame SelectorsarrayAn ordered array of CSS selectors or XPaths to locate nested iframes containing the target element. Provide selectors in order from outermost to innermost iframe (e.g., ['#parent-frame', '.child-frame'] for an element inside a child iframe that's within a parent iframe). Leave empty if the element is not inside any iframes.
Timeout (ms)integer5000Sets the maximum timeout for the activity. Defaults to 5000ms (5 seconds)

Outputs

NameTypeDescription
outputVariablebooleanSpecifies the name of the variable that will store the boolean result.