Get username and password for sina weibo

来源:互联网 发布:网络教育电大 编辑:程序博客网 时间:2024/05/22 02:02
#-*- coding: gb2312 -*-from win32com.client import Dispatch as DSPfrom PAM30 import PAMIE as PIEcls_id = '{9BA05972-F6A8-11CF-A442-00A0C90A8F39}'# find and attach the open IEdef get_cur_ie():    wins = DSP(cls_id)    for win in wins:        if 'weibo.com' in win.locationURL:            #print win.locationURL            ie = PIE(cur_ie=win)            return ie    return None#-- get_cur_ie --# get the username and passworddef get_info():    ie = get_cur_ie()    usr = ie.getTextBoxValue('loginname', 'value')    psw = ie.getTextBoxValue('password', 'value')    print 'Username: <%s>, Password: <%s>' % (usr, psw)    pass#-- get_info --# the main function entryif __name__ == '__main__':    get_info()    pass#-- main --