Skip to content

Commit

Permalink
parse english and welsh only division counts
Browse files Browse the repository at this point in the history
Fixes #63
  • Loading branch information
struan committed Mar 17, 2017
1 parent b7b303a commit 4b90d64
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pyscraper/new_hansard.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,21 @@ def parse_division(self, division):
continue
self.parse_para(para)

# FIXME - we should actually store the numbers
england_tags = division.xpath('./ns:EnglandWales/ns:hs_Para/* | ./ns:England/ns:hs_Para/*', namespaces=self.ns_map)
if len(england_tags):
self.mark_xpath_all_seen(division, './ns:EnglandWales | ./ns:England')
self.mark_xpath_all_seen(division, './ns:EnglandWales/ns:hs_Para | ./ns:England/ns:hs_Para')
details = etree.Element('p')
text = ''
for england_tag in england_tags:
self.mark_seen(england_tag)
content = tag.text
if content:
text += content
details.text = text
self.current_speech.append(details)

def parse_time(self, tag):
self.mark_seen(tag)
time_txt = u''.join(tag.xpath('.//text()'))
Expand Down

0 comments on commit 4b90d64

Please sign in to comment.