CODE:
import mysql.connector
from bs4 import BeautifulSoup
import requests
URL = "https://parade.com/937586/parade/life-quotes/"
web_page = requests.get(URL)
soup = BeautifulSoup(web_page.text, "html.parser")
quote = [(x.get_text(strip=True, separator=" ")) for x in soup.select(
'span[data-parade-type="promoarea"] .figure_block ~ p')]
db = mysql.connector.Connect(
host="127.0.0.1",
user="root",
password="Demon@",
database="my_quotes",
charset="utf8mb4"
)
mycursor = db.cursor()
sql = "INSERT INTO quoteslist (id, Quotes) VALUES (%S,%S)"
mycursor.execute(sql, quote)
db.commit()
db.close()
OUTPUT ERROR:
line 32, in <module>mycursor.execute(sql, quote)
mysql.connector.errors.ProgrammingError: Not all parameters were
used in the SQL statement
In this code, I done WebScraping all quotes in URL and I want to store data to msql.So, I create connection python server to mysql server and i created DATABASE , created table column Quotes and id, When come to insert data, I try using both execute or executemany to store data multiple rows. But its getting error, Can anyone suggest me which line code went wrong.