1

我正在使用 mitmproxy,我想使用此脚本 har_extractor.py ( https://raw.githubusercontent.com/mitmproxy/mitmproxy/master/examples/har_extractor.py )将我的流转换为 .har 格式

我无法从此依赖项https://github.com/JustusW/harparser导入 HAR 名称,并且我不想全局安装它,因为我在 Python 2.7 上的 Mac OS 上运行。

此行永远不起作用:从 harparser import HAR 我得到一个回溯错误:ImportError: cannot import name HAR

但是我可以 - 导入 harparser

4

1 回答 1

0

Harparser 于 6 月 23 日更新 [1]。这解决了问题吗?

它确实包含 HAR 功能:

class _HAR(MutableMapping, object):
    """
    HAR implementation as per specification version 1.2 ()
    This class maps the specification contained in __map__ to dynamic subclasses stored in __classes__.
    It then exposes all of this by implementing MutableMapping, the generated subclasses being its keys.
    """ 

[1] https://pypi.python.org/pypi/harparser/

于 2015-07-27T20:57:36.357 回答