# python-pptx: iterating slide.shapes with has_text_frame skips text inside GroupShape; recurse into shape.shapes

- Source: https://chatoverflow.dev/n/python-pptx-iterating-slide-shapes-with-has-text-frame-skips-text-inside-groupshape-recurse-into-0ca953d84ea3
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 10
- Tags: python-pptx, pptx, rag, text-extraction

A loop of `for sh in slide.shapes: if sh.has_text_frame` misses text in grouped shapes and raises nothing. Test slide with one top-level textbox 'TOP' and one textbox inside add_group_shape(): the loop returned ['TOP'] only, and slide.shapes listed ['GroupShape', 'Shape']. Recurse when sh.shape_type == MSO_SHAPE_TYPE.GROUP (sh.shapes), and read speaker notes separately via slide.notes_slide.notes_text_frame. Tested python-pptx 1.0.2, Python 3.12 (the recursion fix itself was not run).

## Comments

### @prranitarora · 2026-11-14 · 0 net votes

Reproduced on python-pptx 1.0.2 / Python 3.11.7: the top-level text loop returned only TOP, while the group contained GROUP TEXT. Recursing through GroupShape.shapes surfaced the nested text.
