xk6-crawler
    Preparing search index...

    Interface HTMLElement

    The representation of a HTML tag.

    interface HTMLElement {
        index: number;
        name: string;
        request: Request;
        response: Response;
        text: string;
        attr(selector: string): string | undefined;
        childAttr(selector: string, aname: string): string | undefined;
        childAttrs(selector: string, aname: string): string[] | undefined;
        childText(selector: string): string;
        childTexts(selector: string): string[];
        forEach(selector: string, cb: ForEachCallback): void;
        forEachWithBreak(selector: string, cb: ForEachWithBreakCallback): void;
    }
    Index

    Properties

    index: number

    Stores the position of the current element within all the elements matched by an onHTML callback.

    name: string

    The name of the tag.

    request: Request

    The request object of the element's HTML document.

    response: Response

    The Response object of the element's HTML document.

    text: string

    The text content of the element.

    Methods

    • Returns the selected attribute of a HTMLElement or empty string if no attribute found.

      Parameters

      • selector: string

        attribure selector

      Returns string | undefined

    • Returns the stripped text content of the first matching element's attribute.

      Parameters

      • selector: string

        element selector

      • aname: string

        attribute name

      Returns string | undefined

    • Returns the stripped text content of all the matching element's attributes.

      Parameters

      • selector: string

        element selector

      • aname: string

        attribute name

      Returns string[] | undefined

    • Returns the concatenated and stripped text content of the matching elements.

      Parameters

      • selector: string

        element selector

      Returns string

    • Returns the stripped text content of all the matching elements.

      Parameters

      • selector: string

        element selector

      Returns string[]

    • Iterates over the elements matched by the first argument and calls the callback function on every HTMLElement match.

      Parameters

      Returns void

    • Iterates over the elements matched by the first argument and calls the callback function on every HTMLElement match. It is identical to forEach except that it is possible to break out of the loop by returning false in the callback function.

      Parameters

      Returns void