Skip to content

Commit

Permalink
handle mutiple para tags in a debate question
Browse files Browse the repository at this point in the history
Fix for the parser failing to pick up all the text if there is more than
one hs_Para element instite a Question tag
  • Loading branch information
struan committed Mar 6, 2017
1 parent cb2b94e commit 9f0e0a4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pyscraper/new_hansard.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,15 @@ def parse_question(self, question):

p.text = re.sub('\n', ' ', text)
tag.append(p)

if len(para) > 1:
for p in para:
text = self.get_single_line_text_from_element(p)
if text != '':
p = etree.Element('p')
p.text = re.sub('\n', ' ', text)
tag.append(p)

self.root.append(tag)

def parse_indent(self, tag):
Expand Down

0 comments on commit 9f0e0a4

Please sign in to comment.