TweetCollector
can get tweets from Twitter Search and User Profile.
-
This scraper only work with chronium based browser for now
-
Change the
BROWSER_PATH
inutils\setting_files\settings.py
to where your browser .exe file -
For search tweet using query, in the root folder of this project, run command:
python search.py -q query
-
You can also use helper parameter
-
username (
-u
or--username
), to get tweet from certain user -
limit (
-l
or--limit
), to limit the tweet collected -
year (
-y
oryear
), to search on certain year -
since (
-s
orsince
), when the tweet started collected (YYYY-MM-dd) -
until (
-e
oruntil
), date where tweet last collected (YYYY-MM-dd)python search.py -q query -l 50 --year 2022
-
-
The tweets will be saved to disk in
data/
in default settings with format of Json. Change theDATA_DIR
inutils\setting_files\settings.py
if you want another location. -
You can also get tweets from certain username (limit are the only option available in this function) with command:
python profile.py -u username
-
You can also get tweets from certain username with replies (limit are the only option available in this function) with command:
python profile_with_replies.py -u username