1. Use version 1.2.5 of the mysqldb library. An error was reported when inserting the database in the pipeline file of scrapy.
2.
pipeline
import MySQLdb
import os.path
class ProjectPipeline(object):
3.scrapy
import MySQLdb
import os.path
class WeatherPipeline(object):
4. So here"s the problem! Why did I check it many times and didn"t find any difference between the two, which led to the syntax error of my first file! I am a novice, doing graduation project, sincerely beg God not to dislike, give me some advice! Thank you!