在首次使用scrapy框架的过程中,一直是对着别人的框架步骤撸代码的。然而,撸着撸着发现好像别人的也用不了。后面就只能自己找踏坑了。
问题报错:
1,IndexError: list index out of range
2,pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use nea
3,to your MySQL server version for the right syntax to use near 'message_text(500))' at line 1")
4,pymysql.err.OperationalError: (1049, "Unknown database 'test'")
5,mysql一直没数据
问题解释:
1,顾名思义是长度过长问题,但是因为是抄别人的代码,一直以为代码没问题。于是各种找资源的问题。这个搞了很久,最后发现是
for i in range(0, len(item["title"])-1)
这里的len(item["title"])没有-1
2,不太懂是什么缘故,看网络说是单引号或者是双引号导致的问题
3,我一开始使用的是char(500),报错说是最大只能是char(255)。然后我在message_text(500)也