Skip to content

Commit

Permalink
Merge branch 'kirkland_scraper' of https://github.com/JMAConsulting/s…
Browse files Browse the repository at this point in the history
…crapers-ca into kirkland_scraper
  • Loading branch information
samJMA committed Nov 20, 2024
2 parents d3894c4 + 8f5acfb commit ac99311
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ca_qc_kirkland/people.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@

class KirklandPersonScraper(CanadianScraper):
def scrape(self):
page = self.lxmlize(COUNCIL_PAGE, "iso-8859-1")
councillors = page.xpath('//table/tbody[not(@id)]/tr/td[@valign="top"]')
page = self.lxmlize(COUNCIL_PAGE)

councillors = page.xpath('//div[@class="container_content"]//tbody/tr')
assert len(councillors), "No councillors found"
for councillor in councillors:
if councillor == councillors[0]:
Expand All @@ -22,11 +23,12 @@ def scrape(self):

name = councillor.xpath(".//strong/text()")[0]

# Using self.get_phone does not include the extension #
phone = (
councillor.xpath('.//div[contains(text(), "#")]/text()')[0]
.replace("T ", "")
.replace(" ", "-")
.replace(".", ",") # correcting a typo
.replace(".", ",")
.replace(",-#-", " x")
)

Expand Down

0 comments on commit ac99311

Please sign in to comment.