HandleMemory
ClassSource
HandleMemory[_Tag](process_func: Callable[[dict[str, Any], str, _Tag], _Tag | None])
Temporary memory designed for parsing the data that may need to handle children by customized methods and record special information.
Arguments
Requires
| Name | Type | Required | |
|---|---|---|---|
process_func | Callable[[dict[str, Any], str, _Tag], _Tag | None] | A scope-limited processor function. The input arguments are:
It will return the argument |
Methods
process
v_1: _Tag | None = self.process(name: str, node: _Tag)
Run the processing for a specific tag node.
Requires
| Name | Type | Required | |
|---|---|---|---|
name | str | Equivalent to tag.name.casefold() | |
node | _Tag | The HTML tag node that would be used for catching the data. |
Returns
| Name | Type | |
|---|---|---|
v_1 | _Tag | None | Return Tag if it should be further parsed. If this value is None, the given node (including its children) will be dropped in the parsed results. |