diff --git a/ca_qc_dollard_des_ormeaux/people.py b/ca_qc_dollard_des_ormeaux/people.py index ef11a5f8..f9b2ccda 100644 --- a/ca_qc_dollard_des_ormeaux/people.py +++ b/ca_qc_dollard_des_ormeaux/people.py @@ -29,8 +29,9 @@ def scrape(self): p = Person(primary_org="legislature", name=name, district=district, role=role) p.add_source(COUNCIL_PAGE) - p.image = councillor.xpath(".//@data-src")[0] - + img_path = councillor.xpath(".//@data-src") + if img_path: + p.image = img_path[0] p.add_contact("email", email) p.add_contact("voice", general_phone, "legislature") p.add_contact("fax", general_fax, "legislature")