INNER CODE UNIT · Ruby

node_for

rubycdp/ferrum · lib/ferrum/accessibility.rb:28

    def node_for(node)
      partial_tree(node: node).find { |ax_node| !ax_node.ignored? }
    end

    #
    # The partial AX tree for a DOM node.
    #
    # @param [Ferrum::Node] node
    # @param [Boolean] fetch_relatives
    # @return [Array<AXNode>]
    #
    def partial_tree(node:, fetch_relatives: false)
      nodes = node.page.command("Accessibility.getPartialAXTree",
                                nodeId: node.node_id,
                                fetchRelatives: fetch_relatives)["nodes"]
      build(nodes)
    end

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…