我正在使用带有 selenium webdriver 的 Browsermob 代理来捕获 HAR 日志。我能够生成日志,但没有捕获 pageTimings。其余所有数据都被捕获。知道这里有什么问题吗?
我是否需要使用此调用等待一些时间:
PUT /proxy/[port]/wait - 等待所有请求完成
遵循简短答案后的更新:
- 从 git 获取最新快照,构建它。
- 从分发模块启动代理 - “主”程序。
- 日志被捕获
- 每次页面源更改后,我都会调用以强制代理通过 PUTing 到 /proxy/{port}/har/pageRef 来结束页面
- 使用页面引用生成日志,但仍然没有填充 pageTimings。
更新截图:
使用小代理后出现日志错误:
[ERROR 2015-05-18T10:29:00,288 org.littleshoot.proxy.impl.ClientToProxyConnection] (LittleProxy-ClientToProxyWorker-1) (AWAITING_INITIAL) [id: 0x1961ff09, /0:0:0:0:0:0:0:1:63598 => /0:0:0:0:0:0:0:1:8445]: Caught an exception on ClientToProxyConnection java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.SocketDispatcher.read0(Native Method) ~[?:1.8.0_45]
at sun.nio.ch.SocketDispatcher.read(Unknown Source) ~[?:1.8.0_45]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source) ~[?:1.8.0_45]
at sun.nio.ch.IOUtil.read(Unknown Source) ~[?:1.8.0_45]
at sun.nio.ch.SocketChannelImpl.read(Unknown Source) ~[?:1.8.0_45]
at io.netty.buffer.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:447) ~[netty-all-4.0.27.Final.jar:4.0.27.Final]
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:881) ~[netty-all-4.0.27.Final.jar:4.0.27.Final]
at io.netty.buffer.WrappedByteBuf.writeBytes(WrappedByteBuf.java:641) ~[netty-all-4.0.27.Final.jar:4.0.27.Final]
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:241) ~[netty-all-4.0.27.Final.jar:4.0.27.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:119) [netty-all-4.0.27.Final.jar:4.0.27.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [netty-all-4.0.27.Final.jar:4.0.27.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [netty-all-4.0.27.Final.jar:4.0.27.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [netty-all-4.0.27.Final.jar:4.0.27.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [netty-all-4.0.27.Final.jar:4.0.27.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111) [netty-all-4.0.27.Final.jar:4.0.27.Final]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_45]