我试图使用工具箱从下面的链接来打开文件WARC与Python: http://warc.readthedocs.org/en/latest/开放WARC文件
当打开文件:
import warc
f = warc.open("00.warc.gz")
一切都很好,在F对象是:
<warc.warc.WARCFile instance at 0x1151d34d0>
然而,当我试图通过读取文件中的一切:
012出现for record in f:
print record['WARC-Target-URI'], record['Content-Length']
以下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/xxx/anaconda/lib/python2.7/site-packages/warc/warc.py", line 390, in __iter__
record = self.read_record()
File "/Users/xxx/anaconda/lib/python2.7/site-packages/warc/warc.py", line 373, in read_record
header = self.read_header(fileobj)
File "/Users/xxx/anaconda/lib/python2.7/site-packages/warc/warc.py", line 331, in read_header
raise IOError("Bad version line: %r" % version_line)
IOError: Bad version line: 'WARC/0.18\n'
这是因为我的WARC文件版本不被我使用的是WARC工具箱或别的什么支持?
这就是错误所说的。 – simonzack 2014-09-11 10:19:04