Permalink
Browse files

DC legislator fixes

  • Loading branch information...
1 parent b1aabbf commit 88023c3e175fcb328f6c69901a7fa82d13a6667c @jamesturk jamesturk committed Jan 3, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 openstates/dc/legislators.py
@@ -19,7 +19,7 @@ def scrape(self, term, chambers):
doc = lxml.html.fromstring(data)
doc.make_links_absolute(council_url)
# page should have 13 unique council URLs
- urls = set(doc.xpath('//a[contains(@href, "dccouncil.us/council/")]/@href'))
+ urls = set(doc.xpath('//a[contains(@href, "/council/")]/@href'))
print '\n'.join(urls)
assert len(urls) <= 13, "should have 13 unique councilmember URLs"
@@ -53,7 +53,11 @@ def scrape(self, term, chambers):
office_address = get_field(doc, "Office:")
phone = get_field(doc, "Tel:")
- phone, fax = phone.split(' | Fax: ')
+ if phone.endswith('| Fax:'):
+ fax = None
+ phone = phone.strip('| Fax:') or None
+ else:
+ phone, fax = phone.split(' | Fax: ')
email = doc.xpath('//a[starts-with(text(), "Send an email")]/@href')[0].split(':')[1]

0 comments on commit 88023c3

Please sign in to comment.