# -*- coding: utf-8 -*-
#by:pako
#email:zealzpc@gmail.com
import win32com.client
import time
ie6=win32com.client.Dispatch("InternetExplorer.Application")
ie6.Navigate("http://www.tudou.com/")
ie6.Visible=1
while ie6.Busy:
time.sleep(1)
document=ie6.Document
document.getElementById("email").value="username" #tudou.com user name
document.getElementById("pwd").value="password" #tudou.com user password
document.forms[1].submit()
time.sleep(4)
print 'have login'
document.getElementById("uInfo").getElementsByTagName("span")[0].firstChild.click()
print ' logout'