fix parsing duration when >1h
This commit is contained in:
parent
0b3b020798
commit
738ddc9c60
1 changed files with 2 additions and 2 deletions
|
|
@ -45,9 +45,9 @@ class SearchPage(BasePage):
|
|||
date = datetime.datetime(year, month, day)
|
||||
|
||||
duration = select(li, 'p.duree', 1).text
|
||||
m = re.match(r'((\d+)min)?(\d+)s', duration)
|
||||
m = re.match(r'((\d+)h)?((\d+)min)?(\d+)s', duration)
|
||||
if m:
|
||||
duration = datetime.timedelta(minutes=int(m.group(2) or 0), seconds=int(m.group(3)))
|
||||
duration = datetime.timedelta(hours=int(m.group(2) or 0), minutes=int(m.group(4) or 0), seconds=int(m.group(5)))
|
||||
else:
|
||||
raise SelectElementException('Unable to match duration (%r)' % duration)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue