Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Victoria scraper mayor #443

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ca_bc_victoria/people.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
bzhangjma marked this conversation as resolved.
Show resolved Hide resolved
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)
Expand Down