Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

Cannnot save into csv #983

Open
irvanseptiar opened this issue Oct 23, 2020 · 9 comments
Open

Cannnot save into csv #983

irvanseptiar opened this issue Oct 23, 2020 · 9 comments

Comments

@irvanseptiar
Copy link

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

@yogeshmotwani1
Copy link

same error with me

@yogeshmotwani1
Copy link

how did you overcome @irvanseptiar ?

@frazaatif
Copy link

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

@Shawn1206
Copy link

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)

@frazaatif
Copy link

frazaatif commented Oct 28, 2020

@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
Copy link

@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.

@LinqLover
Copy link
Contributor

@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?! :-)

@himanshudabas
Copy link
Contributor

@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.

@LinqLover
Copy link
Contributor

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

6 participants