I'm trying to import a feed into a Mysql database hosted on pythoneverywhere using python but i can't seem to make it work. here is the code i'm using.
import MySQLdb
import feedparser
myfeed = feedparser.parse("http://www.couponchief.com/rss/")
for item in myfeed['items']:
title = item.title
link = item.link
description = item.description
print title
print link
print description
db =
MySQLdb.connect('mysql.server','lesmun','*******','lesmun$default');
with db:
cur = db.cursor()
cur.execute("INSERT INTO ini(title, link, description)VALUES(%s,
%s, %s)", (title,link,description))
print 'Succesfull!'
# close the cursor
cur.close()
# close the connection
db.close ()
any suggestions?