WebPagetest Forums

Full Version: .pcap to .har conversion
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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] <pcap file> [<har file>]"
^
SntaxError: invalid syntax

How should it be run?

Your help is much appreciated

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] <pcap file> [<har file>]"
^
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: https://github.com/andrewf/pcap2har (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 <module>
from pcap2har import pcap
File "C:\Python27\pcap2har-master\pcap2har\pcap.py", line 5, in <module>
from pcaputil import *
File "C:\Python27\pcap2har-master\pcap2har\pcaputil.py", line 6, in <module>
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).
Reference URL's