tweepy stream to sqlite database - invalid synatx

后端 未结 4 1781
你的背包
你的背包 2021-01-07 10:05

The code below is streaming the twitter public timeline for a variable which output any tweets to the console. I\'d like the save the same variables (status.text, status.aut

4条回答
  •  死守一世寂寞
    2021-01-07 10:26

    I'm quite new to tweepy . But these are the modifications that worked for me . You need to add VALUES after INSERT INTO TWEETS . Also , don't forget to commit the changes . This is the link I referred to : related post

         cur.execute("INSERT INTO TWEETS VALUES(?, ?, ?, ?)", (status.text, 
                                                            status.author.screen_name, 
                                                            status.created_at, 
                                                            status.source))
    
         con.commit()
    

提交回复
热议问题