Here's the code, i want to insert data from a website into a mysql table.
import requests
import mysql.connector
from bs4 import BeautifulSoup
r_1=requests.get(...)
soup=BeautifulSoup(r_1.content,'html.parser')
r_2=soup.find(id='main')
r_3=r_2.find_all('div',class_='...')
cnx=mysql.connector.connect(user=m_1,password=m_2,database=m_3)
cursor=cnx.cursor()
for i in r_3:
r_4=i.find('h4',class_='...')
r_5=i.find('div',class_='...')
r_6=r_5.find('div',class_='...')
a_1=(r_4.text,r_6.text)
cursor.executemany('insert into truecar (price,Miles) values (%s,%s)',a_1)
cursor.close()
cnx.commit()
I receive the error below
Exception has occurred: InterfaceError
Failed executing the operation; Could not process parameters
question from:
https://stackoverflow.com/questions/65944418/im-trying-to-insert-some-data-into-a-mysql-table-but-i-receive-an-interface-err 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…