for i in Tree.fromstring(parsestr).subtrees():
    if i.label() == 'NP':
        print(i)
for i in Tree.fromstring(parsestr).subtrees():
    if i.label() == 'NP':
        pass
Finding head of a noun phrase in NLTK and stanford parse according to the rules of finding head of a NP