Python Ubuntu服务器上的Scrapy Splash:得到一个意外的关键字参数';编码';
我正在使用的Scrapy Splash在我的本地机器上运行良好,但是当我在Ubuntu服务器上使用它时,它返回这个错误。为什么呢?它是由内存不足引起的吗Python Ubuntu服务器上的Scrapy Splash:得到一个意外的关键字参数';编码';,python,web-scraping,scrapy,scrapy-splash,splash-js-render,Python,Web Scraping,Scrapy,Scrapy Splash,Splash Js Render,我正在使用的Scrapy Splash在我的本地机器上运行良好,但是当我在Ubuntu服务器上使用它时,它返回这个错误。为什么呢?它是由内存不足引起的吗 File "/usr/local/lib64/python2.7/site-packages/twisted/internet/defer.py", line 1299, in _inlineCallbacks result = g.send(result) File "/usr/local/lib/python2.7/site
File "/usr/local/lib64/python2.7/site-packages/twisted/internet/defer.py", line 1299, in _inlineCallbacks
result = g.send(result)
File "/usr/local/lib/python2.7/site-packages/scrapy/core/downloader/middleware.py", line 53, in process_response
spider=spider)
File "/usr/local/lib/python2.7/site-packages/scrapy_splash/middleware.py", line 387, in process_response
response = self._change_response_class(request, response)
File "/usr/local/lib/python2.7/site-packages/scrapy_splash/middleware.py", line 402, in _change_response_class
response = response.replace(cls=respcls, request=request)
File "/usr/local/lib/python2.7/site-packages/scrapy/http/response/text.py", line 50, in replace
return Response.replace(self, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/scrapy/http/response/__init__.py", line 79, in replace
return cls(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/scrapy_splash/response.py", line 33, in __init__
super(_SplashResponseMixin, self).__init__(url, *args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'encoding'
更新
只有在使用localhost作为SPLASH\u URL时才会发生这种情况。我使用准确的URL来解决这个问题:
SPLASH_URL = 'http://therealip:8050'
任何本地主机解决方案都不起作用。我认为这是一个虫子在刮擦飞溅
更新
事实证明,如果我关闭Crawlera,错误也就消失了。但随后又产生了另一个错误。最好不要在配置中使用localhost
TypeError:init()获得意外的关键字参数“encoding”
似乎您将一个额外的参数“encoding”传递给了类init(可能创建实例)。
试着调查一下