ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/FreeBSDAdmin/Reminder/wellsfargo.py
Revision: 1178
Committed: 2009-05-17T14:30:08-07:00 (16 years, 1 month ago) by douglas
Content type: text/x-python
File size: 834 byte(s)
Log Message:
Checkpoint the current state of the code.

File Contents

# Content
1 # Wells Fargo
2 #
3 # Douglas Thrift
4 #
5 # $Id$
6
7 import common
8 from datetime import date, datetime
9 import re
10 import website
11
12 class Bank(website.Website, common.Bank):
13 DUE_ON = re.compile(r'DUE ON (\d{2}/\d{2}/\d{2})')
14
15 def __init__(self, username, password, debug):
16 website.Website.__init__(self, debug)
17
18 self.browser.open('https://www.wellsfargo.com/')
19 self.browser.select_form(name = 'signon')
20
21 self.browser['userid'] = username
22 self.browser['password'] = password
23
24 self.browser.submit()
25
26 self.browser.follow_link(text = 'Accounts')
27
28 def due(self, account):
29 try:
30 due_on = self.Soup(self._follow_link(text_regex = account)).find(text = self.DUE_ON)
31
32 if due_on is None:
33 return date.fromtimestamp(0)
34
35 return datetime.strptime(self.DUE_ON.search(due_on).group(1), '%m/%d/%y').date()
36 finally:
37 self._back()

Properties

Name Value
svn:keywords Id