Traceback (most recent call last): File "G:\pythonProject\Changgou\Changgou\spiders\main.py", line 3, in <module> cmdline.execute('scrapy crawl crawl_changgou'.splist()) AttributeError: 'str' object has no attribute 'splist'
时间: 2024-04-28 19:26:42 浏览: 70
Mac下anaconda中Spyder打开报错Traceback(most recent call last)…问题
5星 · 资源好评率100%
这个错误是因为在执行Scrapy命令时,将字符串“'scrapy crawl crawl_changgou'”分割成“['scrapy', 'crawl', 'crawl_changgou']”,但是将“split”拼写成了“splist”,导致“AttributeError: 'str' object has no attribute 'splist'”。正确的写法应该是“split”。您可以将命令改为以下代码来解决这个问题:
cmdline.execute('scrapy crawl crawl_changgou'.split())
阅读全文