国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

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

瀏覽:5日期:2022-08-07 18:46:02

本文實(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.jb51.net") pythoncom.PumpMessages() ie.Quit()

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

DownloadBegintestDownloadCompleteDownloadBegintestDownloadCompletedocumentComplete of http://pos.baidu.com/acomadn=0ltr=&cf=u2DownloadBegintestDownloadComplete

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

您可能感興趣的文章:

python實(shí)現(xiàn)的重啟關(guān)機(jī)程序?qū)嵗?/p>

python實(shí)現(xiàn)自動(dòng)登錄人人網(wǎng)并采集信息的方法

python自動(dòng)zip壓縮目錄的方法

python實(shí)現(xiàn)自動(dòng)更換ip的方法

Python自動(dòng)重試HTTP連接裝飾器

python定時(shí)檢查某個(gè)進(jìn)程是否已經(jīng)關(guān)閉的方法

python關(guān)閉windows進(jìn)程的方法

python實(shí)現(xiàn)自動(dòng)重啟本程序的方法

標(biāo)簽: Python 編程
相關(guān)文章:
主站蜘蛛池模板: 常山县| 金坛市| 金寨县| 根河市| 江西省| 彭山县| 嫩江县| 内黄县| 武强县| 福清市| 景洪市| 九江县| 仁布县| 鄂伦春自治旗| 青岛市| 包头市| 闽清县| 合水县| 扎兰屯市| 满城县| 运城市| 广宁县| 衡阳市| 兴业县| 信阳市| 双辽市| 环江| 普宁市| 松原市| 英德市| 汉阴县| 临颍县| 利川市| 靖边县| 鄄城县| 达孜县| 紫云| 巩留县| 无极县| 花莲市| 根河市|