zip ファイルをダウンロードして開こうとしていますが、zipfile でファイル タイプ ハンドルを使用する際に問題が発生しているようです。これを実行すると、「AttributeError: addinfourl インスタンスに属性 'seek' がありません」というエラーが表示されます。
import zipfile
import urllib2
def download(url,directory,name):
webfile = urllib2.urlopen('http://www.sec.gov'+url)
webfile2 = zipfile.ZipFile(webfile)
content = zipfile.ZipFile.open(webfile2).read()
localfile = open(directory+name, 'w')
localfile.write(content)
localfile.close()
return()
download(link.get("href"),'./fails_data', link.text)