我試圖使用工具箱從下面的鏈接來打開文件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