报错如下:
File “/usr/local/lib/python3.5/dist-packages/scrapy/spiders/crawl.py”, line 60, in _requests_to_follow
for n, rule in enumerate(self._rules):
AttributeError: ‘Watch1Spider’ object has no attribute ‘_rules’
原因:
复制代码
1
2
3
4
5
6
7class Watch1Spider(CrawlSpider): # @classmethod def __init__(self): self.driver = webdriver.Chrome() self.header = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134'}
CrawlSpider不支持def init(self):,目前我还没想到有什么解决办法,以后再说吧,希望大佬们可以支招。
最后
以上就是飞快小兔子最近收集整理的关于Watch1Spider' object has no attribute '_rules'的全部内容,更多相关Watch1Spider'内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复