for thematic_break in all_thematic_breaks: #print(thematic_break) page_number = thematic_break.previous_sibling.previous_sibling.previous_sibling.get_text(strip=True) all_pa