Open lingvisa opened 3 years ago
2021-02-26 12:11:22 [scrapy.utils.log] INFO: Scrapy 2.4.1 started (bot: counselor) 2021-02-26 12:11:22 [scrapy.utils.log] INFO: Versions: lxml 4.5.0.0, libxml2 2.9.10, cssselect 1.1.0, parsel 1.6.0, w3lib 1.22.0, Twisted 20.3.0, Python 3.7.3 (default, Dec 13 2019, 19:58:14) - [Clang 11.0.0 (clang-1100.0.33.17)], pyOpenSSL 20.0.1 (OpenSSL 1.1.1j 16 Feb 2021), cryptography 3.4.6, Platform Darwin-19.6.0-x86_64-i386-64bit 2021-02-26 12:11:22 [scrapy.utils.log] DEBUG: Using reactor: twisted.internet.selectreactor.SelectReactor 2021-02-26 12:11:22 [scrapy.crawler] INFO: Overridden settings: {'AUTOTHROTTLE_ENABLED': True, 'BOT_NAME': 'counselor', 'NEWSPIDER_MODULE': 'counselor.spiders', 'SPIDER_MODULES': ['counselor.spiders'], 'USER_AGENT': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:68.0) ' 'Gecko/20100101 Firefox/68.0'} 2021-02-26 12:11:22 [scrapy.extensions.telnet] INFO: Telnet Password: d86b117f784151a4 2021-02-26 12:11:22 [scrapy.middleware] INFO: Enabled extensions: ['scrapy.extensions.corestats.CoreStats', 'scrapy.extensions.telnet.TelnetConsole', 'scrapy.extensions.memusage.MemoryUsage', 'scrapy.extensions.logstats.LogStats', 'scrapy.extensions.throttle.AutoThrottle'] 2021-02-26 12:11:22 [scrapy.middleware] INFO: Enabled downloader middlewares: ['scrapy.downloadermiddlewares.httpauth.HttpAuthMiddleware', 'scrapy.downloadermiddlewares.downloadtimeout.DownloadTimeoutMiddleware', 'scrapy.downloadermiddlewares.defaultheaders.DefaultHeadersMiddleware', 'scrapy.downloadermiddlewares.useragent.UserAgentMiddleware', 'scrapy.downloadermiddlewares.retry.RetryMiddleware', 'scrapy.downloadermiddlewares.redirect.MetaRefreshMiddleware', 'scrapy.downloadermiddlewares.httpcompression.HttpCompressionMiddleware', 'scrapy.downloadermiddlewares.redirect.RedirectMiddleware', 'scrapy.downloadermiddlewares.cookies.CookiesMiddleware', 'scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware', 'scrapy.downloadermiddlewares.stats.DownloaderStats'] 2021-02-26 12:11:22 [scrapy.middleware] INFO: Enabled spider middlewares: ['scrapy.spidermiddlewares.httperror.HttpErrorMiddleware', 'scrapy.spidermiddlewares.offsite.OffsiteMiddleware', 'scrapy.spidermiddlewares.referer.RefererMiddleware', 'scrapy.spidermiddlewares.urllength.UrlLengthMiddleware', 'scrapy.spidermiddlewares.depth.DepthMiddleware'] 2021-02-26 12:11:22 [scrapy.middleware] INFO: Enabled item pipelines: ['counselor.pipelines.WikiPipeline'] 2021-02-26 12:11:22 [scrapy.core.engine] INFO: Spider opened 2021-02-26 12:11:22 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min) 2021-02-26 12:11:22 [scrapy.extensions.telnet] INFO: Telnet console listening on 127.0.0.1:6023 Exception in thread PoolThread-twisted.internet.reactor-0: Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/twisted/_threads/_threadworker.py", line 45, in work for task in iter(queue.get, _stop): AttributeError: 'Queue' object has no attribute 'get' 2021-02-26 12:11:22 [scrapy.core.scraper] ERROR: Error downloading <GET https://zh.wikipedia.org/zh-cn/Category:%E7%9B%8A%E6%99%BA%E6%B8%B8%E6%88%8F> Traceback (most recent call last): File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks result = result.throwExceptionIntoGenerator(g) File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/twisted/python/failure.py", line 512, in throwExceptionIntoGenerator return g.throw(self.type, self.value, self.tb) File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/scrapy/core/downloader/middleware.py", line 45, in process_request return (yield download_func(request=request, spider=spider)) File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/scrapy/utils/defer.py", line 55, in mustbe_deferred result = f(*args, **kw) File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/scrapy/core/downloader/handlers/__init__.py", line 75, in download_request return handler.download_request(request, spider) File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/scrapy/core/downloader/handlers/http11.py", line 88, in download_request return agent.download_request(request) File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/scrapy/core/downloader/handlers/http11.py", line 355, in download_request d = agent.request(method, to_bytes(url, encoding='ascii'), headers, bodyproducer) File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/twisted/web/client.py", line 1744, in request parsedURI.originForm) File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/twisted/web/client.py", line 1521, in _requestWithEndpoint d = self._pool.getConnection(key, endpoint) File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/twisted/web/client.py", line 1400, in getConnection return self._newConnection(key, endpoint) File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/twisted/web/client.py", line 1412, in _newConnection return endpoint.connect(factory) File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/twisted/internet/endpoints.py", line 2120, in connect self._wrapperFactory(protocolFactory) File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/twisted/internet/endpoints.py", line 931, in connect EndpointReceiver, self._hostText, portNumber=self._port File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/twisted/internet/_resolver.py", line 189, in resolveHostName onAddress = self._simpleResolver.getHostByName(hostName) File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/scrapy/resolver.py", line 43, in getHostByName d = super().getHostByName(name, timeout) File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/twisted/internet/base.py", line 288, in getHostByName socket.gethostbyname, name) File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/twisted/internet/threads.py", line 53, in deferToThreadPool threadpool.callInThreadWithCallback(onResult, f, *args, **kwargs) File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/twisted/python/threadpool.py", line 269, in callInThreadWithCallback self._team.do(inContext) File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/twisted/_threads/_team.py", line 166, in do self._coordinator.do(lambda: self._coordinateThisTask(task)) File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/twisted/_threads/_threadworker.py", line 109, in do working.pop(0)() File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/twisted/_threads/_team.py", line 166, in <lambda> self._coordinator.do(lambda: self._coordinateThisTask(task)) File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/twisted/_threads/_team.py", line 187, in _coordinateThisTask @worker.do File "/Users/congminmin/.venv/data_collection/lib/python3.7/site-packages/twisted/_threads/_threadworker.py", line 57, in do self._q.put(task) AttributeError: 'Queue' object has no attribute 'put' 2021-02-26 12:11:23 [scrapy.core.engine] INFO: Closing spider (finished) 2021-02-26 12:11:23 [scrapy.statscollectors] INFO: Dumping Scrapy stats: {'downloader/exception_count': 1, 'downloader/exception_type_count/builtins.AttributeError': 1, 'downloader/request_bytes': 309, 'downloader/request_count': 1, 'downloader/request_method_count/GET': 1, 'elapsed_time_seconds': 0.352491, 'finish_reason': 'finished', 'finish_time': datetime.datetime(2021, 2, 26, 20, 11, 23, 103564), 'log_count/ERROR': 1, 'log_count/INFO': 10, 'memusage/max': 64348160, 'memusage/startup': 64348160, 'scheduler/dequeued': 1, 'scheduler/dequeued/memory': 1, 'scheduler/enqueued': 1, 'scheduler/enqueued/memory': 1, 'start_time': datetime.datetime(2021, 2, 26, 20, 11, 22, 751073)} 2021-02-26 12:11:23 [scrapy.core.engine] INFO: Spider closed (finished)
另外,from queue import Queue 这个在子目录,也没法直接导入上一级目录的 Queue 吧
我也是这个问题 你好请问你解决了吗
你好, 我也遇到相同问题,请问有解决办法吗? 谢谢!
相同的问题,期待解决方案