Skip to content

Commit

Permalink
go back to the previous 'xpath' string
Browse files Browse the repository at this point in the history
for properly handling dates and places on birth and death
  • Loading branch information
romjerome authored Jun 7, 2021
1 parent f1985fb commit d811438
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions GeneanetForGramps.py
Original file line number Diff line number Diff line change
Expand Up @@ -1188,21 +1188,21 @@ def random_headers():
if verbosity >= 2:
print(_("Sex:"), self.g_sex)
try:
bstring = '//div[@id="perso"]/ul[0]/li[0]/text()'
bstring = '//li[contains(., "'+_("Born")+'")]/text()'
if verbosity >= 3:
print("bstring: "+bstring)
birth = tree.xpath(bstring)
LOG.debug(tree.xpath('//div[@id="perso"]//ul/li/text()'))
LOG.debug(tree.xpath('//div[@id="perso"]//ul/li[0]/text()'))
except:
birth = [""]
if verbosity >= 3:
print(_("birth")+": %s"%(birth))
try:
dstring = '//div[@id="perso"]/ul[0]/li[1]/text()'
dstring = '//li[contains(., "'+_("Deceased")+'")]/text()'
if verbosity >= 3:
print("dstring: "+dstring)
death = tree.xpath(dstring)
LOG.debug(tree.xpath('//div[@id="perso"]//ul/li/text()'))
LOG.debug(tree.xpath('//div[@id="perso"]//ul/li[1]/text()'))
except:
death = [""]
if verbosity >= 3:
Expand Down

0 comments on commit d811438

Please sign in to comment.