本文實例講述了python操作ie登陸土豆網的方法。分享給大家供大家參考。具體如下:
這里利用ie操作登陸土豆網,很簡單,僅做一下記錄,以備后用。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
# -*- coding: utf-8 -*- import win32com.client import time ie6 = win32com.client.Dispatch( "InternetExplorer.Application" ) ie6.Navigate( "http://login.tudou.com/login.do?noreg=ok" ) ie6.Visible = 0 while ie6.Busy: time.sleep( 1 ) document = ie6.Document document.getElementById( "email" ).value = "******" #登錄賬號 document.getElementById( "pass" ).value = "******" #登錄密碼 document.getElementById( "login_submit" ).click() #點擊登陸 time.sleep( 4 ) print 'LOGIN SUCCESS' |
希望本文所述對大家的Python程序設計有所幫助。