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