最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Python自動(dòng)調(diào)用IE打開(kāi)某個(gè)網(wǎng)站的方法

 更新時(shí)間:2015年06月03日 12:04:49   作者:xm1331305  
這篇文章主要介紹了Python自動(dòng)調(diào)用IE打開(kāi)某個(gè)網(wǎng)站的方法,涉及Python調(diào)用系統(tǒng)win32組件的相關(guān)技巧,需要的朋友可以參考下

本文實(shí)例講述了Python自動(dòng)調(diào)用IE打開(kāi)某個(gè)網(wǎng)站的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:

import win32gui 
import win32com 
import win32com.client 
import pythoncom 
import time 
class Test: 
  def runtest(self): 
    print 'test' 
class EventHandler: 
  def OnVisible(self,visible): 
    global bVisibleEventFired 
    bVisibleEventFired = 1 
  def OnDownloadBegin(self): 
    print 'DownloadBegin' 
    self.runtest() 
    self.value = 1 
  def OnDownloadComplete(self): 
    print 'DownloadComplete' 
    self.value += 1 
  def OnDocumentComplete(self,pDisp=pythoncom.Missing,URL=pythoncom.Missing): 
    print 'documentComplete of %s' %URL 
    print self.value 
class H(Test,EventHandler): 
  pass 
ie = win32com.client.DispatchWithEvents('InternetExplorer.Application',H)
ie.Visible = 1 
ie.Navigate("www.fzitv.net") 
pythoncom.PumpMessages() 
ie.Quit() 

運(yùn)行該程序可打開(kāi)www.fzitv.net網(wǎng)站,同時(shí)輸出如下結(jié)果:

DownloadBegin
test
DownloadComplete
DownloadBegin
test
DownloadComplete
documentComplete of http://pos.baidu.com/acom?adn=0&at=128&aurl=&cad=1&ccd=32&cec=gb2312&cfv=17&ch=0&col=zh-cn&conOP=0&cpa=1&dai=1&dis=0&layout_filter=rank%2Cimage&ltr=&ltu=http%3A%2F%2Fwww.fzitv.net%2F&lunum=6&n=jb51_cpr&pcs=1387x729&pis=10000x10000&ps=2348x191&psr=1440x900&pss=1387x2350&qn=6a0cce8cf992d19c&rad=&rsi0=1000&rsi1=60&rsi5=4&rss0=&rss1=&rss2=&rss3=&rss4=&rss5=&rss6=&rss7=&scale=&skin=tabcloud_skin_6&stid=5&td_id=1919103&tn=baiduCustSTagLinkUnit&tpr=1433304842125&ts=1&version=2.0&xuanting=0&dtm=BAIDU_DUP2_SETJSONADSLOT&dc=2&di=u1919103&ti=%E8%84%9A%E6%9C%AC%E4%B9%8B%E5%AE%B6_www.fzitv.net&tt=1433304842078.47.125.125
2
documentComplete of http://www.fzitv.net/
2
DownloadBegin
test
DownloadComplete
documentComplete of http://pos.baidu.com/wh/o.htm?ltr=&cf=u
2
DownloadBegin
test
DownloadComplete

希望本文所述對(duì)大家的Python程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論

凌源市| 洛隆县| 浦江县| 高淳县| 方正县| 保山市| 抚州市| 定西市| 岳普湖县| 巴林左旗| 明星| 稻城县| 孝昌县| 梓潼县| 漳平市| 正宁县| 泉州市| 安陆市| 阳城县| 杨浦区| 依安县| 河北区| 宁化县| 华安县| 咸宁市| 英德市| 商南县| 苗栗市| 宕昌县| 电白县| 沂水县| 育儿| 昌宁县| 宝丰县| 木兰县| 水城县| 开原市| 获嘉县| 饶平县| 印江| 图木舒克市|