Twint: Cannnot save into csv

Created on 23 Oct 2020  路  9Comments  路  Source: twintproject/twint

CRITICAL:root:twint.output:_output:CSV:Error:'Config' object has no attribute 'Tabs'
'Config' object has no attribute 'Tabs' [x] output._output

All 9 comments

same error with me

how did you overcome @irvanseptiar ?

Try doing t.Config['tweet'] - ["id","location","date","time"....] , make sure of 't.Store_csv = True' and 't.Output = ".csv"'. This works for me

Try doing t.Config['tweet'] - ["id","location","date","time"....] , make sure of 't.Store_csv = True' and 't.Output = ".csv"'. This works for me
Below is my code, it just raise this error, could you please your implementation and help me out?

CRITICAL:root:twint.output:_output:CSV:Error:'location'
'location' [x] output._output
1321413272885669889 2020-10-28 07:27:29 -0400 @att your business fiber internet has been down since Monday. Update on repair, please? @ATTHelp #outage

import twint
c = twint.Config()
c.Custom['tweet'] = ['id', 'location', 'date', 'time']
c.Lang = 'en'
c.Profile_full = True
c.Search = 'outage ATT'
c.Store_csv = True
c.Limit = 10
c.Output = 'test.csv'

twint.run.Search(c)

@Shawn1206 Yes it turns out 'Location' has not been working since a few days. As for storing to csv, if the above doesn't work, you could always enable pandas and use it to save the csv, and maybe even clean it before.
EDIT: Ran below code and got 180 tweets :)
import twint
import pandas

import nest_asyncio
nest_asyncio.apply()

t = twint.Config()
t.Search = "outage ATT"
t.Pandas = True
t.Since = "2020-10-01"
t.Lang = 'en'
t.Profile_full = True
twint.run.Search(t)
twint.storage.panda.Tweets_df.to_csv("output.csv")

@Shawn1206 Yes it turns out 'Location' has not been working since a few days. As for storing to csv, if the above doesn't work, you could always enable pandas and use it to save the csv, and maybe even clean it before.
EDIT: Ran below code and got 180 tweets :)
import twint
import pandas

import nest_asyncio
nest_asyncio.apply()

t = twint.Config()
t.Search = "outage ATT"
t.Pandas = True
t.Since = "2020-10-01"
t.Lang = 'en'
t.Profile_full = True
twint.run.Search(t)
twint.storage.panda.Tweets_df.to_csv("output.csv")

Thanks a lot! From the output, it seems that there are a lot of empty cells in the "place" attribute, maybe people just don't like share their geo information.

@Shawn1206 A very naive question: How do you manage to use twint at this time? I thought it is still broken (see #604)? If I run your code example (without the nest_asyncio part), it gives me the usual CRITICAL:root:twint.run:Twint:Feed:noDataExpecting errors. How did you make this work?! :-)

@LinqLover
Twint was ported to the newer v2 twitter API endpoints a while ago,
You must be using the older installation if you are still getting the CRITICAL:root:twint.run:Twint:Feed:noDataExpecting
ERROR.

Try updating your _twint installation_ from GitHub and check if it works for you.

@himanshudabas Woah, thank you very much! Looks like it was forgotten to report this update on #604, which is still open. :-)

Was this page helpful?
0 / 5 - 0 ratings