Skip to content

Commit

Permalink
[Scotland] Per-file global division number.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheyWorkForYou Live CVS User committed May 3, 2024
1 parent c5409de commit adaa66d
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 @@ -200,9 +200,10 @@ def process_raw_html(raw_html: Tag, agenda_item_url: str) -> BeautifulSoup:
# - create a divisioncount object that counts the for, against abstensions
# and spoiled ballots (always 0 for sp)

for div_num, division in enumerate(speaker.find_all("division")):
for division in speaker.find_all("division"):
div_counts = {"for": 0, "against": 0, "abstentions": 0, "spoiledvotes": 0}
division["divnum"] = div_num
division["divnum"] = tidy_up_html.div_num
tidy_up_html.div_num += 1
divisioncount = soup.new_tag("divisioncount")
for vote in division.find_all("mspname"):
div_counts[vote["vote"]] += 1
Expand Down Expand Up @@ -258,6 +259,7 @@ def tidy_up_html(xml_path: Path, output_dir: Path):

soup = BeautifulSoup(xml, "html.parser")

tidy_up_html.div_num = 0
for item in soup.find_all("agenda_item"):
agenda_item_url = item.get("url")

Expand Down

0 comments on commit adaa66d

Please sign in to comment.