Open irisdemented opened 3 years ago
Did you manage to figure this out? I'm encountering the same thing.
I have not yet figured it out - I stopped trying to get the user info and moved on to a new project. Would still lvoe some resolution though!
Did you manage to figure this out? I'm encountering the same thing.
@irisdemented @jomorrcode Try using the branch mentioned in #1002. I tried your sample code and it worked for me!
pip install --upgrade git+https://github.com/himanshudabas/twint.git@origin/fix-parser#egg=twint
@irisdemented @jomorrcode Try using the branch mentioned in #1002. I tried your sample code and it worked for me!
pip install --upgrade git+https://github.com/himanshudabas/twint.git@origin/fix-parser#egg=twint
I tried this branch and it seems the problem still exists. I am trying to scrape profiles of a short list of users. It works for the most of users, but for some, it gives me the following error:
CRITICAL:root:twint.get:User:'user'
Issue Template
Please use this template!
Initial Check
pip3 install --user --upgrade -e git+https://github.com/twintproject/twint.git@origin/master#egg=twint
;I confirm that I have checked all of the above. There are similar issues regarding 'config' object and 'tweet' object, but unfortunately I have not been able to figure out a fix for my 'user' object issue.
Command Ran
Description of Issue
I grabbed some random usernames to duplicate what I was seeing with my list, which is basically that any user object that has no URL will not output to csv.
In the usernames above, the first one, TTP_updates, will output to csv, no problem. The second one will not.
This is the terminal output:
4894323374 | Tech Transparency Project | @TTP_updates | Private: False | Verified: False | Bio: The Tech Transparency Project (TTP) is a research initiative of @Accountable_Org that seeks to hold large technology companies accountable. | Location: Washington, D.C. | Url: https://t.co/b3Wtm4lFNu | Joined: 2016-02-11 21:28:33 UTC | Tweets: 3602 | Following: 605 | Followers: 3950 | Likes: 218 | Media: 708 | Avatar: https://pbs.twimg.com/profile_images/1235218504191791111/h79m07CJ_normal.jpg 'user' object has no attribute 'url' CRITICAL:root:twint.output:_output:CSV:Error:'user' object has no attribute 'url' 'user' object has no attribute 'url' [x] output._output 1097842897733378049 | titi | @fullsunmyno1 | Private: False | Verified: False | Bio: | Location: | Url: | Tweets: 4114 | Following: 517 | Followers: 66 | Likes: 10479 | Media: 258 | Avatar: https://pbs.twimg.com/profile_images/1320816756126932992/WdJljbF0_normal.jpg
I tried adding a try / except block around URL in user.py and was able to get the script to continue - but I could not get any csv output, unfortunately.
I looked at the user object for a failing one and ur['data']['user']['legacy'] does not have a ['url']. I think it should be able to output to csv still, just haven't figured out where I need to tweak it.
Any ideas?
Environment Details
This is running on a server running Ubuntu 18.04. I am running via python3 script_name.py