1 |
< |
# Citi Card |
1 |
> |
# Shell MasterCard |
2 |
|
# |
3 |
|
# Douglas Thrift |
4 |
|
# |
9 |
|
import website |
10 |
|
|
11 |
|
class Bank(website.Website): |
12 |
+ |
PAYMENT_DUE = re.compile(r'[A-Z][a-z]{2}\. \d{1,2}, \d{4}') |
13 |
+ |
|
14 |
|
def __init__(self, username, password, debug): |
15 |
|
website.Website.__init__(self, debug) |
16 |
|
|
17 |
< |
self.browser.open('https://www.citicards.com/') |
17 |
> |
self.browser.open('http://www.shellmc.accountonline.com/') |
18 |
|
self.browser.select_form(name = 'LOGIN') |
19 |
|
|
20 |
|
self.browser['USERNAME'] = username |
22 |
|
|
23 |
|
self.browser.submit() |
24 |
|
|
25 |
< |
def __call__(self, account): |
24 |
< |
payment_due = re.compile(r'[A-Z][a-z]{2}\. \d{1,2}, \d{4}') |
25 |
< |
|
25 |
> |
def due(self, account): |
26 |
|
try: |
27 |
< |
return datetime.strptime(payment_due.search(self.Soup(self.browser.follow_link(text_regex = account)).find(text = re.compile('Payment Due')).findNext(text = payment_due)).group(0), '%b. %d, %Y').date() |
27 |
> |
return datetime.strptime(self.PAYMENT_DUE.search(self.Soup(self.browser.follow_link(text_regex = account)).find(text = re.compile('Payment Due')).findNext(text = self.PAYMENT_DUE)).group(0), '%b. %d, %Y').date() |
28 |
|
finally: |
29 |
|
self.browser.back() |