Ejemplo n.º 1
0
from auth import simulate_login
from pageparse import *

#获取参数
parser = argparse.ArgumentParser()
parser.add_argument('-u', '--user', help='user email')
parser.add_argument('-p', '--psw', help="password")
parser.add_argument('-t', '--target', help='target user ID')
args = parser.parse_args()

email = args.user
psw = args.psw
uid = args.target

#构建连接器
opener = build_opener()

#尝试登录
success, gsid = simulate_login(opener, email, psw)
print 'success: ', success
print 'gsid   : ', gsid
print 'target : ', uid

from sqla_db import DBSaver, DumpSaver

saver = DBSaver(uid, debug=False)
dump = DumpSaver(uid)

def load_page(num):
    """
    load target page back
Ejemplo n.º 2
0
 def __init__(self, opener=None):
     self.opener = opener or build_opener()