Dec-05-2018, 08:42 AM
Hi guys, I’m currently working on a term project surrounding the analysis of Twitter followers. For that, I’m using Tweepy and a GitHub script by Fujman12 scraping information on all of the followers of one account. The output is a CSV file.
Now I’m kind of limited in my knowledge and the Tweepy documentation itself didn’t provide me any answers so there’s a couple of questions I have. It’s mostly about if it would be possible to implement what I’m trying to achieve and maybe an idea how to - I’m obviously not asking you to write an entire script for me!
a) Would it be possible to also scrape the amount of tweets the followers have at that point of time? And the date their account was created?
These are the values currently being scraped:
I feel like this text has been a mess but I hope I somehow managed to get my point across? I would also appreciate if anybody could point me into the direction of Tweepy manuals or guides beyond the documentation because simply looking at readily available GitHub scripts hasn’t taught me much about it.
Thanks!
Now I’m kind of limited in my knowledge and the Tweepy documentation itself didn’t provide me any answers so there’s a couple of questions I have. It’s mostly about if it would be possible to implement what I’m trying to achieve and maybe an idea how to - I’m obviously not asking you to write an entire script for me!
a) Would it be possible to also scrape the amount of tweets the followers have at that point of time? And the date their account was created?
These are the values currently being scraped:
write_to_sheet(u.screen_name, u.followers_count, u.friends_count, u.location, u.description)This is what the function write_to_sheet currently looks like:
def write_to_sheet(name, number_of_followers, number_following, location, description): global row_count ws1["A%d" % row_count] = name ws1["B%d" % row_count] = number_of_followers ws1["C%d" % row_count] = number_following ws1["D%d" % row_count] = location ws1["E%d" % row_count] = "https://twitter.com/%s" % name ws1["F%d" % row_count] = description wb.save("result.xlsx") row_count += 1b) Is there any way for me to use Python to also scrape the tweets of the followers, meaning multiple accounts at once (not all tweets of each account, just maybe the latest 5?)? Since I will end up with a long list of followers after running my initial script, I wouldn’t be able to download the tweets of each account I’ve received one by one (there’s probably going to be more than one million names) but would there be a way to use my xlsx file as input for a script that scrapes tweets?
I feel like this text has been a mess but I hope I somehow managed to get my point across? I would also appreciate if anybody could point me into the direction of Tweepy manuals or guides beyond the documentation because simply looking at readily available GitHub scripts hasn’t taught me much about it.
Thanks!