Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
TimLundSE26 committed Dec 14, 2017
1 parent 36b7251 commit 221eb78
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scraper.py
Expand Up @@ -107,10 +107,11 @@ def search():
print mgUserBodySection.tag

matchObj = re.search( r'Surgery details', mgUserBodySectionName, re.I)
if matchObj:
if re.search( r'Surgery details', mgUserBodySectionName, re.I):
surgery = "".join(mgUserBodySection.xpath('text()')).strip()
print re.sub(u"(\u2018|\u2019)", "'", surgery)

elif re.search( r'terms of office', mgUserBodySectionName, re.I):
print len(mgUserBodySection.xpath('li'))
# surgery = "".join(mgUserBodySection.xpath('text()')).strip()
# AttributeError: '_ElementStringResult' object has no attribute 'xpath'

Expand Down

0 comments on commit 221eb78

Please sign in to comment.