# -*- coding:utf-8 -*-
from ssl import _create_unverified_context
from json import loads
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import tkinter.messagebox
import sqlite3
import pymysql
import urllib.request
import urllib.parse
class mysql_conn(object):
# 魔术方法, 初始化, 构造函数
def __init__(self):
self.db = pymysql.connect(host='localhost', port=3306, user='root', password='', db='BliBli', charset='utf8' )
self.cursor = self.db.cursor()
# 执行modify(修改)相关的操作
def execute_modify_mysql(self, sql):
self.cursor.execute(sql)
self.db.commit()
# 魔术方法, 析构化 ,析构函数
def __del__(self):
self.cursor.close()
self.db.close()
class getMovieInRankingList:
用python爬虫爬取B站排名靠前的番剧并存储到sql数据库
最新推荐文章于 2024-04-17 23:41:31 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)