Skip to content

Commit

Permalink
Similar solution to burnaby web scraper.
Browse files Browse the repository at this point in the history
  • Loading branch information
samJMA committed Oct 29, 2024
1 parent d35d876 commit 1bd0cde
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ca_qc_kirkland/people.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@

class KirklandPersonScraper(CanadianScraper):
def scrape(self):
page = self.lxmlize(COUNCIL_PAGE)
def decode_email(e):
de = ""
k = int(e[:2], 16)

for i in range(2, len(e) - 1, 2):
de += chr(int(e[i : i + 2], 16) ^ k)

return de
page = self.lxmlize(COUNCIL_PAGE, "iso-8859-1")

# councillors = page.xpath('//div[@id="PageContent"]/table/tbody/tr/td')
councillors = page.xpath('//table/tbody[not(@id)]/tr/td[@valign="top"]')
assert len(councillors), "No councillors found"
for councillor in councillors:
Expand Down

0 comments on commit 1bd0cde

Please sign in to comment.