TreeWalker
TreeWalker
Visão geral
TreeWalker é uma classe em Aspose.Html FOSS para Python.
Travessia do DOM no estilo cursor limitada a uma subárvore raiz.
Esta classe fornece 8 métodos para trabalhar com objetos TreeWalker em programas Python. Os métodos disponíveis incluem: __init__, first_child, last_child, next_node, next_sibling, parent_node, previous_node, previous_sibling. Todos os membros públicos estão acessíveis a qualquer aplicação Python após a instalação do pacote Aspose.Html FOSS para Python. Propriedades: current_node, filter, root, what_to_show.
Propriedades
| Nome | Tipo | Acesso | Descrição |
|---|---|---|---|
root | "Node" | Leitura | O nó raiz da subárvore deste caminhante. |
what_to_show | int | Leitura | A máscara de bits what_to_show passada na construção. |
filter | `“Callable[[Node], int] | None”` | Leitura |
current_node | "Node" | Leitura/Escrita | O nó de posição atual do walker. |
Métodos
| Assinatura | Descrição |
|---|---|
| `init(root: “Node”, what_to_show: int, node_filter: “Callable[[Node], int] | None”)` |
parent_node() → `“Node | None”` |
first_child() → `“Node | None”` |
last_child() → `“Node | None”` |
previous_sibling() → `“Node | None”` |
next_sibling() → `“Node | None”` |
next_node() → `“Node | None”` |
previous_node() → `“Node | None”` |