Skip to content

Commit

Permalink
make ups parser not so strict
Browse files Browse the repository at this point in the history
  • Loading branch information
ljmerza committed Aug 22, 2019
1 parent 89116eb commit 26ba7d7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions custom_components/email/parsers/ups.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ def parse_ups(email):
links = [link.get('href') for link in soup.find_all('a')]
for link in links:
if not link: continue
match = re.search('tracknum=(.*?)&AgreeToTermsAndConditions', link)

match = re.search('tracknum=(.*?)&', link)
if match and match.group(1) not in tracking_numbers:
tracking_numbers.append(match.group(1))

return tracking_numbers

0 comments on commit 26ba7d7

Please sign in to comment.