.pcap to .har conversion

can main.py in mobile>pcap2har be used from command line to convert a .pcap file to .har format?

When run from command line, it shows the following error

File “main.py”, line 47
print file, “[options] []”
^
SntaxError: invalid syntax

How should it be run?

Your help is much appreciated
[hr]
can main.py in www>mobile>pcap2har be used from command line to convert a .pcap file to .har format?

When run from command line, it shows the following error

File “main.py”, line 47
print file, “[options] []”
^
SyntaxError: invalid syntax

How should it be run from command line?
I run this on a Win 8 system.
Input: .pcap file captured using wireshark
Expected output: .har file

Or can I use pcap2har.php ?

Your help is much appreciated

I tend to use the online converter - https://pcapperf.appspot.com/ or AT&T’s ARO but that just shows a waterfall and doesn’t export a pcap

The actual pcap2har project is here: GitHub - andrewf/pcap2har: A convertor from .pcap network capture files to HTTP Archive files. (and it’s what the online converter uses as well).

I get the following error when I run main.py from command line

C:\Python27\pcap2har-master>main.py
Traceback (most recent call last):
File “C:\Python27\pcap2har-master\main.py”, line 13, in
from pcap2har import pcap
File “C:\Python27\pcap2har-master\pcap2har\pcap.py”, line 5, in
from pcaputil import *
File “C:\Python27\pcap2har-master\pcap2har\pcaputil.py”, line 6, in
import resource
ImportError: No module named resource

How could this be fixed?

You should file an issue in the github project and ask. It’s a separate utility from WebPagetest and we were just using it (for a while, it is no longer used).