pypage2: automatically identify node type