AR
Size: a a a
AR
VB
AS
AR
__init__
же всё делаетсяVB
VB
VB
self.uri =?
AR
AR
AR
СТ
AR
VB
from scrapy.exporters import CsvItemExporterТобишь это должно работать?
from scrapy.utils.project import get_project_settings
class CsvCustomExporter(CsvItemExporter):
def __init__(self, path, *args, **kwargs):
settings = get_project_settings()
dir_path = settings.get(name='FEED_DIRECTORY')
uri = settings.get(name='FEED_URI')
kwargs['delimiter'] = '|'
kwargs['fields_to_export'] = settings.getlist(name='FEED_EXPORT_FIELDS')
self.urifmt = dir_path + '/' + uri
super(CsvCustomExporter, self).__init__(*args, **kwargs)
VB
scrapy crawl top30 -s FEED_DIRECTORY='/home'если так запустить?
AR
AR
VB