dataabc / weibo-search

获取微博搜索结果信息,搜索即可以是微博关键词搜索,也可以是微博话题搜索
1.62k stars 364 forks source link

运行出错显示这个怎么解决 #339

Open aligagag opened 1 year ago

aligagag commented 1 year ago

2023-03-12 18:15:15 [twisted] CRITICAL: Traceback (most recent call last): File "F:\python\anaconda\lib\site-packages\twisted\internet\defer.py", line 1697, in _inlineCallbacks result = context.run(gen.send, result) File "F:\python\anaconda\lib\site-packages\scrapy\crawler.py", line 122, in crawl self.engine = self._create_engine() File "F:\python\anaconda\lib\site-packages\scrapy\crawler.py", line 136, in _createengine return ExecutionEngine(self, lambda : self.stop()) File "F:\python\anaconda\lib\site-packages\scrapy\core\engine.py", line 78, in init self.downloader = downloader_cls(crawler) File "F:\python\anaconda\lib\site-packages\scrapy\core\downloader__init.py", line 85, in init__ self.middleware = DownloaderMiddlewareManager.from_crawler(crawler) File "F:\python\anaconda\lib\site-packages\scrapy\middleware.py", line 68, in from_crawler return cls.from_settings(crawler.settings, crawler) File "F:\python\anaconda\lib\site-packages\scrapy\middleware.py", line 43, in from_settings mwcls = load_object(clspath) File "F:\python\anaconda\lib\site-packages\scrapy\utils\misc.py", line 60, in load_object mod = import_module(module) File "F:\python\anaconda\lib\importlib__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 850, in exec_module File "", line 228, in _call_with_frames_removed File "F:\python\anaconda\lib\site-packages\scrapy\downloadermiddlewares\retry.py", line 25, in from twisted.web.client import ResponseFailed File "F:\python\anaconda\lib\site-packages\twisted\web\client.py", line 24, in from twisted.internet.endpoints import HostnameEndpoint, wrapClientTLS File "F:\python\anaconda\lib\site-packages\twisted\internet\endpoints.py", line 63, in from twisted.python.systemd import ListenFDs File "F:\python\anaconda\lib\site-packages\twisted\python\systemd.py", line 18, in from attrs import Factory, define ModuleNotFoundError: No module named 'attrs'

aligagag commented 1 year ago

pip install atters后显示Requirement already satisfied: attrs in f:\python\anaconda\lib\site-packages (21.2.0) 若果是要install到某路径下,我应该怎么找到安装在那个目录

dataabc commented 1 year ago

可能和python版本有关,需要python3版本。

aligagag commented 1 year ago

我的是python3.9,是不是因为安装依赖不在成功的原因,我pip install -r requirements.txt时显示Requirement already satisfied: Pillow>=8.1.1 in f:\python\anaconda\lib\site-packages (from -r requirements.txt (line 1)) (8.4.0) 这个问题要怎么解决

aligagag commented 1 year ago

作者大大可以分享下你的版本吗,我重新装了anaconda3.9还是不行

---原始邮件--- 发件人: "Chen @.> 发送时间: 2023年3月12日(周日) 晚上11:56 收件人: @.>; 抄送: @.**@.>; 主题: Re: [dataabc/weibo-search] 运行出错显示这个怎么解决 (Issue #339)

可能和python版本有关,需要python3版本。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

dataabc commented 1 year ago

可能和anaconda有关,单独安装python就可以。

aligagag commented 1 year ago

解决了,感谢大大,不过我也有了这个报错,看到别人也遇到了,请问大大这个解决了吗 AttributeError: 'NoneType' object has no attribute 'split' image AttributeError: 'NoneType' object has no attribute 'split' 2023-03-14 16:32:31 [scrapy.core.scraper] ERROR: Spider error processing <GET https://s.weibo.com/weibo?q=%E4%BA%A4%E9%80%9A&scope=ori&suball=1&timescope=custom:2022-03-06-23:2022-03-07-0&page=1> (referer: https://s.weibo.com/weibo?q=%E4%BA%A4%E9%80%9A&scope=ori&suball=1&timescope=custom:2022-03-06-0:2022-03-07-0&page=1) Traceback (most recent call last): File "e:\python38\lib\site-packages\scrapy\utils\defer.py", line 257, in iter_errback yield next(it) File "e:\python38\lib\site-packages\scrapy\utils\python.py", line 312, in next return next(self.data) File "e:\python38\lib\site-packages\scrapy\utils\python.py", line 312, in next return next(self.data) File "e:\python38\lib\site-packages\scrapy\core\spidermw.py", line 104, in process_sync for r in iterable: File "e:\python38\lib\site-packages\scrapy\spidermiddlewares\offsite.py", line 28, in return (r for r in result or () if self._filter(r, spider)) File "e:\python38\lib\site-packages\scrapy\core\spidermw.py", line 104, in process_sync for r in iterable: File "e:\python38\lib\site-packages\scrapy\spidermiddlewares\referer.py", line 353, in return (self._set_referer(r, response) for r in result or ()) File "e:\python38\lib\site-packages\scrapy\core\spidermw.py", line 104, in process_sync for r in iterable: File "e:\python38\lib\site-packages\scrapy\spidermiddlewares\urllength.py", line 27, in return (r for r in result or () if self._filter(r, spider)) File "e:\python38\lib\site-packages\scrapy\core\spidermw.py", line 104, in process_sync for r in iterable: File "e:\python38\lib\site-packages\scrapy\spidermiddlewares\depth.py", line 31, in return (r for r in result or () if self._filter(r, response, spider)) File "e:\python38\lib\site-packages\scrapy\core\spidermw.py", line 104, in process_sync for r in iterable: File "C:\Users\Administrator\Desktop\git\weibo-search-master\weibo-search-master\weibo\spiders\search.py", line 198, in parse_by_hour for weibo in self.parse_weibo(response): File "C:\Users\Administrator\Desktop\git\weibo-search-master\weibo-search-master\weibo\spiders\search.py", line 356, in parse_weibo weibo['bid'] = sel.xpath( AttributeError: 'NoneType' object has no attribute 'split'

aligagag commented 1 year ago

另外,作者大大,我的crawl里多了这个文件,用txt打开是乱码,请问这个是什么原因,是正常的吗 image

dataabc commented 1 year ago

这个可能是微博格式改了,您可以参考网友的方案,修改search.py,之前您回复过那个issue。乱码正常,那是进度,不用管。

litalxh commented 1 year ago

AttributeError: 'NoneType' object has no attribute 'split'

作者大大,我也遇到了split的问题,这个怎么解决

litalxh commented 1 year ago

AttributeError: 'NoneType' object has no attribute 'split'

作者大大,我也遇到了split的问题,这个怎么解决

我修改过了search.py文件,用了微博旧版的cookie但还是遇到了这个问题

dataabc commented 1 year ago

@litalxh 你回退回老版本看看,每个人情况不一样。

497hwq commented 11 months ago

你好,我也出现ModuleNotFoundError: No module named 'attrs'这个问题,请问是如何解决的

497hwq commented 11 months ago

解决了