From e21d8eb086cc34f5d11a349a93193f2178b47dda Mon Sep 17 00:00:00 2001 From: Brighten Zhang Date: Wed, 30 Oct 2024 15:37:21 -0400 Subject: [PATCH] cleanup --- ca_bc_victoria/people.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ca_bc_victoria/people.py b/ca_bc_victoria/people.py index 9796b6ca..12a70505 100644 --- a/ca_bc_victoria/people.py +++ b/ca_bc_victoria/people.py @@ -36,7 +36,10 @@ def scrape(self): '//ul[@class="menu menu--level-0"]//a[contains(., "Mayor") and not(contains(., "Council"))]/@href' )[0] page = self.lxmlize(mayor_url) - role, name = page.xpath("//h1/span")[0].text_content().split(" ", 1) + role = "Mayor" + role, name = page.xpath( + '//ul[@class="menu menu--level-0"]//a[contains(., "Mayor") and not(contains(., "Council"))]/text()' + )[0].split(" ", 1) photo = councillor.xpath('//div[@class="field__item"]/img/@src')[0] email = self.get_email(page) phone = self.get_phone(page)