爬虫写入数据库时报错:
AttributeError: module 'MySQLdb' has no attribute 'cursors'
解决方法:
引入
import MySQLdb.cursors# 引入这个依赖
如下所示
import codecs
import json
from scrapy.pipelines.images import ImagesPipeline
from scrapy.exporters import JsonItemExporter
from twisted.enterprise import adbapi
import MySQLdb
import MySQLdb.cursors# 引入这个依赖