What is wrong in my code ? I want to add %s to my mysql db.
titlux = tree.xpath('//*[@id="offer-title"]/h1/text()')
pretx = tree.xpath('//*[@id="offer-price-stock"]/div[3]/span/@content')
print "%s," % titlux
print "%s," % pretx
print "\n"
conn = ..............
x = conn.cursor()
try:
x.execute ("""INSERT INTO produse (titlu, pret) VALUES (%s, %s)""")
conn.commit()
except:
conn.rollback()
conn.close()