I used the following command in order to create my own database:
sqlite3 mydb.db
I used the follwing command for making my table:
CREATE TABLE mytable (hostName CHAR(50) PRIMARY KEY, content TEXT);
And this is part of my script:
hostName='mywebsite.com'
cur=con.cursor()
cur.execute('SELECT hostName FROM mytable WHERE hostName="'+hostName+'"')
data=cur.fetchall()
cont=session.get('http://'+hostName).content
cur.execute('INSERT INTO mytable (hostName,content) VALUES (\''+hostName+'\',\''+str(cont)+'\')')
But when I get the website content it doesn't write to the table when the content is not short.
Maybe there is a parameter larger than TEXT
.
Aucun commentaire:
Enregistrer un commentaire