opencivicdata / scrapers-ca

Canadian legislative scrapers
MIT License
29 stars 25 forks source link

Add support for cloudflare obfuscated emails in get_email method #395

Closed rafe-murray closed 1 month ago

rafe-murray commented 1 month ago

A number of municipal sites use cloudflare to obfuscate their emails. This means that if you want to get their emails you have to write custom code each time. However, they use a consistent function to do this obfuscation. This PR changes the get_email method to also scrape cloudflare protected emails and decode them. Several other scrapers are updated to make use of this change, simplifying their code significantly.