godkingjay / selenium-twitter-scraper

This is a Twitter Scraper which uses Selenium for scraping tweets. It is capable of scraping tweets from home, user profile, hashtag, query or search, and advanced searches.
Apache License 2.0
164 stars 42 forks source link

Add examples to search for @userhandle mentions #2

Closed badjoerichards closed 1 year ago

badjoerichards commented 1 year ago

In the readme and examples, we have search for text, hashtags and listing posts from a user.

However, maybe include an example to search for @userhandle mentions as well?

That would complete the program

godkingjay commented 1 year ago

The program is already capable of that, you can try the "advanced search" of twitter. You can set-up an advanced query there and copy the the resulting string query and give it to the program:

Example:

  1. For tweets mentioning @elonmusk:

    python scraper --query="(@elonmusk)"
  2. For tweets that mentions @elonmusk with atleast 1000 replies from January 01, 2020 - August 31, 2023:

    python scraper --query="(@elonmusk) min_replies:1000 until:2023-08-31 since:2020-01-01"

image

badjoerichards commented 1 year ago

Great, advanced use, thank you