Skip to content

Commit

Permalink
[sp] Structure one sided divisions correctly.
Browse files Browse the repository at this point in the history
SP can have divisions where everyone votes the same way - so there can be just one msplist
  • Loading branch information
ajparsons committed Dec 24, 2024
1 parent 9bdcceb commit 116f649
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyscraper/sp_2024/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,11 @@ def process_raw_html(raw_html: Tag, agenda_item_url: str) -> BeautifulSoup:
speaker.append(vote_div)
vote_tag.decompose()

# now we want to wrap any sequential msplists tags in a division tag
# now we want to wrap any group of msplists tags in a division tag
# in the scottish parliament all the votes *can* be on one side
# and there will be just one msp list
vote_tags = speaker.find_all("msplist")
if len(vote_tags) > 1:
if len(vote_tags) > 0:
division_tag = soup.new_tag("division")
vote_tags[0].insert_before(division_tag)
for vote_tag in vote_tags:
Expand Down

0 comments on commit 116f649

Please sign in to comment.