您好!我的报错结果是这样的:
2023-01-08 15:16:26 [scrapy.core.scraper] ERROR: Spider error processing <GET https://s.weibo.com/weibo?q=%E7%96%AB%E6%83%85&scope=ori&suball=1×cope=custom:2022-12-18-23:2022-12-19-0&page=1> (referer: https://s.weibo.com/weibo?q=%E7%96%AB%E6%83%85&scope=ori&suball=1×cope=custom:2022-12-18-0:2022-12-19-0&page=1)
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/utils/defer.py", line 240, in iter_errback
yield next(it)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/utils/python.py", line 338, in next
return next(self.data)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/utils/python.py", line 338, in next
return next(self.data)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/core/spidermw.py", line 79, in process_sync
for r in iterable:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/spidermiddlewares/offsite.py", line 29, in
return (r for r in result or () if self._filter(r, spider))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/core/spidermw.py", line 79, in process_sync
for r in iterable:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/spidermiddlewares/referer.py", line 336, in
return (self._set_referer(r, response) for r in result or ())
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/core/spidermw.py", line 79, in process_sync
for r in iterable:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/spidermiddlewares/urllength.py", line 28, in
return (r for r in result or () if self._filter(r, spider))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/core/spidermw.py", line 79, in process_sync
for r in iterable:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/spidermiddlewares/depth.py", line 32, in
return (r for r in result or () if self._filter(r, response, spider))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/core/spidermw.py", line 79, in process_sync
for r in iterable:
File "/Users/zhang/Desktop/weibo-search-master/weibo/spiders/search.py", line 198, in parse_by_hour
for weibo in self.parse_weibo(response):
File "/Users/zhang/Desktop/weibo-search-master/weibo/spiders/search.py", line 357, in parse_weibo
'.//div[@class="from"]/a[1]/@href').extract_first(
AttributeError: 'NoneType' object has no attribute 'split'
请问是什么原因呢?尝试换了旧版微博m.weibo.cn的cookie也不管用。非常感谢您!
您好!我的报错结果是这样的: 2023-01-08 15:16:26 [scrapy.core.scraper] ERROR: Spider error processing <GET https://s.weibo.com/weibo?q=%E7%96%AB%E6%83%85&scope=ori&suball=1×cope=custom:2022-12-18-23:2022-12-19-0&page=1> (referer: https://s.weibo.com/weibo?q=%E7%96%AB%E6%83%85&scope=ori&suball=1×cope=custom:2022-12-18-0:2022-12-19-0&page=1) Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/utils/defer.py", line 240, in iter_errback yield next(it) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/utils/python.py", line 338, in next return next(self.data) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/utils/python.py", line 338, in next return next(self.data) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/core/spidermw.py", line 79, in process_sync for r in iterable: File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/spidermiddlewares/offsite.py", line 29, in
return (r for r in result or () if self._filter(r, spider))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/core/spidermw.py", line 79, in process_sync
for r in iterable:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/spidermiddlewares/referer.py", line 336, in
return (self._set_referer(r, response) for r in result or ())
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/core/spidermw.py", line 79, in process_sync
for r in iterable:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/spidermiddlewares/urllength.py", line 28, in
return (r for r in result or () if self._filter(r, spider))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/core/spidermw.py", line 79, in process_sync
for r in iterable:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/spidermiddlewares/depth.py", line 32, in
return (r for r in result or () if self._filter(r, response, spider))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scrapy/core/spidermw.py", line 79, in process_sync
for r in iterable:
File "/Users/zhang/Desktop/weibo-search-master/weibo/spiders/search.py", line 198, in parse_by_hour
for weibo in self.parse_weibo(response):
File "/Users/zhang/Desktop/weibo-search-master/weibo/spiders/search.py", line 357, in parse_weibo
'.//div[@class="from"]/a[1]/@href').extract_first(
AttributeError: 'NoneType' object has no attribute 'split'
请问是什么原因呢?尝试换了旧版微博m.weibo.cn的cookie也不管用。非常感谢您!