def start(self): # read id-pass file cipher = AESCipher(getpass()) try: id, ps = cipher.read_pass() except: print "Cannot read id-pass.txt" exit() browser = webdriver.Chrome(self.DRIVER_PATH) browser.get(self.url) try: # top page block browser.find_element_by_css_selector( "a.btn-03.str-03.str-cv").click() # login page block browser.find_element_by_name("netMemberId").send_keys(id) browser.find_element_by_name("password").send_keys(ps) browser.find_element_by_css_selector( "button.btn-03.str-03.center").click() # needs otp process # displaying charge page block print browser.find_element_by_css_selector("span.num").text # for debug(pause browser) raw_input() finally: browser.quit() """
def __init__(self): cipher = AESCipher(getpass()) try: id,ps = cipher.read_pass("gmail-id-pass.txt") except: print "Cannot read id-pass.txt" exit() try: self.gmail = imaplib.IMAP4_SSL("imap.gmail.com") self.gmail.login(id,ps) except: print "Login Failed." return