twitter-scraper-selenium icon indicating copy to clipboard operation
twitter-scraper-selenium copied to clipboard

scrap hashtag

Open toastyy00 opened this issue 1 year ago • 5 comments

does using hashtags work? I want data on people who use a specific hashtag and find out who uses it the most

toastyy00 avatar Oct 06 '22 15:10 toastyy00

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")

shaikhsajid1111 avatar Oct 06 '22 16:10 shaikhsajid1111

cool. is it possible to scrape the whole hashtag in one day?

toastyy00 avatar Oct 06 '22 22:10 toastyy00

It depends on number of tweets available for that hashtag

shaikhsajid1111 avatar Oct 07 '22 02:10 shaikhsajid1111

okay so is it okay to input 9999 on "tweets_count" to scrap it all?

toastyy00 avatar Oct 07 '22 02:10 toastyy00

I think you might get blocked at some point of time while scraping that amount. Couple of better approach you can use,

  1. 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 .
  2. 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.

shaikhsajid1111 avatar Oct 07 '22 03:10 shaikhsajid1111