运行环境:
这里以windows xp为例:
httpwatchpro-v7.2.23
ActivePython-v2.7.2.5
import win32com.client
__author__ = 'sun'
# Create a new instance of HttpWatch in IE
control = win32com.client.Dispatch('HttpWatch.Controller')
plugin = control.IE.New()
# Start Recording HTTP traffic
plugin.Log.EnableFilter(False)
plugin.Record()
# Goto to the URL and wait for the page to be loaded
plugin.GotoURL("http://www.baidu.com/")
control.Wait(plugin, -1)
# Stop recording HTTP
plugin.Stop()
if plugin.Log.Pages.Count != 0 :
print "\nPage Title: '", plugin.Log.Pages(0).Title , "'"
# Display summary statistics for page
summary = plugin.Log.Pages(0).Entries.Summary
print "Total time to load page (secs): ", summary.Time
print "Number of bytes received on network: ", summary.BytesReceived
print "HTTP compression saving (bytes): ", summary.CompressionSavedBytes
print "Number of round trips: ", summary.RoundTrips
print "Number of errors: ", summary.Errors.Count
# Close down IE
plugin.CloseBrowser()
输出结果:
C:\Python27\python.exe x:/xxx/httpwatchExample.py
Page Title: '百度一下,你就知道'
Total time to load page (secs): 0.463
Number of bytes received on network: 3748
HTTP compression saving (bytes): 4821
Number of round trips: 1
Number of errors: 0
分享到:
相关推荐
做性能测试或者开发的童鞋可以尝试使用,可以很方便的监控到响应时间、资源下载等
调用httpwatch API HttpWatch是强大的网页数据分析工具.集成在Internet Explorer工具栏.包括网页摘要.Cookies管理.缓存管理.消息头发送/接受.字符查询.POST 数据和目录管理功能.报告输出.HttpWatch 是一款能够收集并...
能记录访问网址所调用的链接,很适合做url网站限制之前的分析工作 绿色无广告,有操作文档。
使用与ie7,ie8,ie9和firefox的Http协议抓取包小工具。
自己写的一个httpWatch自动化测试...用户只要安装HttpWatch,并且运行本工具,即可调用httpwatch,自动测试网站,并将测试结果(测试结果_**.hwl)保存下来,开发人员拿到测试结果就可以很方便地查找、分析、定位问题。
httpwatch源码,网络抓包工具源码。
HttpWatch,一个不错的开发辅助工具
HttpWatch是强大的网页数据分析工具.集成在Internet Explorer工具栏.包括网页摘要.Cookies管理.缓存管理.消息头发送/接受.字符查询.POST 数据和目录管理功能.报告输出.HttpWatch 是一款能够收集并显示页页深层信息的...
httpwatch httpwatch httpwatch httpwatch httpwatch httpwatch
HttpWatch是强大的网页数据分析工具.集成在Internet Explorer工具栏.包括网页摘要.Cookies管理.缓存管理.消息头发送/接受.字符查询.POST 数据和目录管理功能.报告输出.HttpWatch 是一款能够收集并显示深层信息的软件...
httpwatch-网页监视工具
httpwatch9.1带破解;httpwatch9.1带破解;httpwatch9.1带破解;httpwatch9.1带破解
HttpWatch 网页数据分析工具,可分析打开网页时网页上每个元素所用的时间以及具体的交互记录,包括Cookies、消息头、字符查询等信息,是分析网站服务器性能的必备工具 HttpWatch 用来分析、优化网页结构非常不错,...
httpwatch安装包
Httpwatch浏览器插件。请求和响应 Httpwatch浏览器插件。请求和响应
httpwatch最新注册版,httpwatch最新注册版,http协议分析的利器
httpwatch httpwatch7.1 亲测好用,备份,带离线注册文件
HttpWatch+Professional+v6.0.14授权文件可用
刚好相互适配的httpwatch和Firefox,自己已经尝试了,提醒一下,要记得卸载干净自己电脑原本的httpwatch和Firefox。