WOLFRAM

Here is an example notebook:

Scrape the text from Section and Text cells in the notebook:

Out[1]=1

Preserve the cell grouping structure in the notebook by specifying the rule FlattenCellGroupsFalse:

In[2]:=2
Out[2]=2