for timestamp, buf in pcap:
    eth = dpkt.ethernet.Ethernet(buf)
if not isinstance(eth.data, dpkt.ip.IP):
    print('Non IP Packet type not supported %s\n' % eth.data.__class__.__name__)
continue
ip = eth.data
if isinstance(ip.data, dpkt.tcp.TCP):
    tcp = ip.data
try:
    request = dpkt.http.Request(tcp.data)
except (dpkt.dpkt.NeedData, dpkt.dpkt.UnpackError):
    continue
Parsing pcap files with dpkt (Python)