Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrap hashtag #38

Open
toastyy00 opened this issue Oct 6, 2022 · 5 comments
Open

scrap hashtag #38

toastyy00 opened this issue Oct 6, 2022 · 5 comments

Comments

@toastyy00
Copy link

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

@shaikhsajid1111
Copy link
Owner

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

@toastyy00
Copy link
Author

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

@shaikhsajid1111
Copy link
Owner

It depends on number of tweets available for that hashtag

@toastyy00
Copy link
Author

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

@shaikhsajid1111
Copy link
Owner

shaikhsajid1111 commented Oct 7, 2022

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.

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

No branches or pull requests

2 participants