pages = [] # list of tuples of page information
for header in soup.findAll('h3', 'sectionHeader'):
headerText = header.string
ul = headerText.find('ul') // get the top list node
labels = [] # list of the contents of the <a>'s
for li in ul:
labels.append(li.a.string) # inner string of the first <a> tag
pages.append((headerText, labels))
That gives you a nice list of tuples of the pages. When you're using
it later on, you can just do iteration like this:
for header, labels in pages:
# work with header
for label in labels:
# work with labels
I probably made a mistake in there somewhere, but that should help
explain things (hopefully).
-Aaron DeVore
Scott
-Aaron DeVore