# -*- coding: utf-8 -*- import os,sys import requests import bs4 import pymysql#import MySQLdb #连接MYSQL数据库 db = pymysql.connect(host='127.0.0.1',user='root',password='mysql',db='test',port=3306,charset='utf8') #db = MySQLdb.connect('127.0.0.1','root'…