我遇到了这样一种情况,当从命令行使用时,我的scrapy代码可以正常工作,但是当我在部署(scrapy-deploy)并使用scrapyd api进行调度后使用同一spider时,会在“ scrapy.extensions.feedexport.FeedExporter”中引发错误”类。
1.“ open_spider”信号错误
2016-05-14 12:09:38 [scrapy] INFO: Spider opened
2016-05-14 12:09:38 [scrapy] ERROR: Error caught on signal handler: <bound method ?.open_spider of <scrapy.extensions.feedexport.FeedExporter object at 0x7fafb1ce4a90>>
Traceback (most recent call last):
File "/home/jonsnow/venv/scrapy1/lib/python2.7/site-packages/twisted/internet/defer.py", line 150, in maybeDeferred
result = f(*args, **kw)
File "/home/jonsnow/venv/scrapy1/lib/python2.7/site-packages/pydispatch/robustapply.py", line 55, in robustApply
return receiver(*arguments, **named)
File "/home/jonsnow/venv/scrapy1/lib/python2.7/site-packages/scrapy/extensions/feedexport.py", line 185, in open_spider
uri = self.urifmt % self._get_uri_params(spider)
TypeError: float argument required, not dict
2.“ item_scraped”信号错误:
2016-05-14 12:09:49 [scrapy] DEBUG: Scraped from <200 https://someurl.>
2016-05-14 12:09:49 [scrapy] ERROR: Error caught on signal handler: <bound method ?.item_scraped of <scrapy.extensions.feedexport.FeedExporter object at 0x7fafb1ce4a90>>
Traceback (most recent call last):
File "/home/jonsnow/venv/scrapy1/lib/python2.7/site-packages/twisted/internet/defer.py", line 150, in maybeDeferred
result = f(*args, **kw)
File "/home/jonsnow/venv/scrapy1/lib/python2.7/site-packages/pydispatch/robustapply.py", line 55, in robustApply
return receiver(*arguments, **named)
File "/home/jonsnow/venv/scrapy1/lib/python2.7/site-packages/scrapy/extensions/feedexport.py", line 210, in item_scraped
slot = self.slot
AttributeError: 'FeedExporter' object has no attribute 'slot'
3.“ close_spider”信号错误:
2016-05-14 12:09:49 [scrapy] INFO: Closing spider (finished)
2016-05-14 12:09:49 [scrapy] ERROR: Error caught on signal handler: <bound method ?.close_spider of <scrapy.extensions.feedexport.FeedExporter object at 0x7fafb1ce4a90>>
Traceback (most recent call last):
File "/home/jonsnow/venv/scrapy1/lib/python2.7/site-packages/twisted/internet/defer.py", line 150, in maybeDeferred
result = f(*args, **kw)
File "/home/jonsnow/venv/scrapy1/lib/python2.7/site-packages/pydispatch/robustapply.py", line 55, in robustApply
return receiver(*arguments, **named)
File "/home/jonsnow/venv/scrapy1/lib/python2.7/site-packages/scrapy/extensions/feedexport.py", line 193, in close_spider
slot = self.slot
AttributeError: 'FeedExporter' object has no attribute 'slot'
也尝试了scrapyd(1.1.0和scrapy版本0.24.6)
当feedexporter无法写入文件时会发生这种情况,而当我在excel中打开以前导出的csv文件时,发生在我身上。尝试关闭打开的导出文件,它将正常工作
问题内容: final Multimap terms = getTerms(bq); for (Term t : terms.keySet()) { Collection C = new HashSet(terms.get(t)); if (!C.isEmpty()) { for (Iterator it = C.iterator(); it.hasNext();) { BooleanClause
问题内容: 我试图将两个’Employee’对象添加到TreeSet中: 但是它抛出一个ClassCastException: 但是,如果我仅将一个对象添加到TreeSet中: 或者,如果我改用HashSet: 那就成功了。为什么会发生异常,我该如何解决? 问题答案: 要么必须实现,或者你需要提供一个比较创建时。 在文档中对此进行了详细说明: 插入排序集中的所有元素都必须实现接口(或被指定的比较器
问题内容: 将字符串解析为字节时出现异常 问题答案: 这是因为默认的parse方法要求使用十进制格式的数字来解析十六进制数字,请使用以下parse: 其中16是解析的基础。 至于您的评论,您是对的。字节的最大值为0x7F。因此,您可以将其解析为并执行二进制与操作以获得LSB,即您的字节:
问题内容: 我有这种方法: 映射: Person.hbm.xml Cars.hbm.xml 此方法适用于单个线程,并且在多个线程上,给我一个错误: AOP交易: 注意:当我在更新后添加Thread.sleep(5000)时,就可以了。 但是这种解决方案并不干净。 问题答案: 我有汽车->(1-n)个地方。而且我在表位置(id_car)有一个外键。此外键没有索引。当我向该外键添加索引时,我的问题已解
当使用Mockito截尾时,我们通常为一个方法指定一个具体的参数。之后,我们可以用相同的参数调用Stubed方法。例如,在下面的代码中,get()用参数0进行了stubed。所以,当调用get()时,get()的参数也是0。因此,get()将返回一个整数,即3。 如果调用语句被修改为: 即参数更改为1,然后Mockito抛出“NullPointerException”,而不是“AssertionE
下面是我的代码: 现在我的脑海中应该不会出现不匹配,因为显然提取了两个整数?!