twitter-scraper-selenium
twitter-scraper-selenium copied to clipboard
scrap hashtag
does using hashtags work? I want data on people who use a specific hashtag and find out who uses it the most
Yeah, hashtag works. You can use scrap_keyword
method to achieve that.
Code should look something like
from twitter_scraper_selenium import scrap_keyword
scrap_keyword(keyword="#YOUR_HASHTAG", browser="firefox",tweets_count=10,output="csv",filename="YOUR_FILENAME")
cool. is it possible to scrape the whole hashtag in one day?
It depends on number of tweets available for that hashtag
okay so is it okay to input 9999 on "tweets_count" to scrap it all?
I think you might get blocked at some point of time while scraping that amount. Couple of better approach you can use,
- In case you get blocked scraping data in unauthenticated way, the crawler will exit itself and give you the data whatever was scraped. You can pass the id of the last tweet under the argument
since_id
. See what all feature you can use here . - You can login using some Twitter account and pass browser profile and scrap in authenticated way. Beware that your account may get blocked as well.