-
Make sure you have Poetry installed. If not, install it by following the instructions here.
-
Install dependencies using Poetry:
poetry install- Create a virtual environment (optional but recommended):
python3 -m venv venv source venv/bin/activate # On Windows, use venv\Scripts\activate- Install dependencies:
pip install selenium-driverless hrequests[all] alive-progressThe project consists of two main modules: find_creators and get_creator.
This module allows you to search for creators based on a keyword.
To run the find_creators module:
python3 -m src.find_creators.main [options]
Options:
-k,--keyword: Search keyword (required)-t,--type: Search type (default: "publication")-r,--range: Increase this value to capture more creators (default: 5)
Examples:
python3 -m src.find_creators.main -k "politics" -t "publication" -r 10
python3 -m src.find_creators.main --keyword "science" --type "post" --range 15Alternatively, you can set the arguments manually in the code. Open src/find_creators/main.py and uncomment and modify lines 18-21:
# args.keyword = "jujutsu kaisen"
# args.type = "publication"
# args.range = 15This module allows you to get detailed information about a specific creator.
To run the get_creator module:
python3 -m src.get_creator.main [options]
Options:
-u,--url: Creator's URL (default: "https://website.com/@jonathanhaidt")
Examples:
python3 -m src.get_creator.main -u "https://website.com/@yourguru"
python3 -m src.get_creator.main --url "https://website.com/@specificcreator"Alternatively, you can set the URL manually in the code. Open src/get_creator/main.py and uncomment and modify lines 14-15:
# args.url = "https://website.com/@jonathanhaidt"Initializes and returns a Selenium WebDriver instance with specific options.
Retrieves basic information about a creator's page.
Retrieves necessary headers and publication ID for API requests.
Saves the scraped data to a CSV file.
The scraped data will be saved in CSV format:
- For
find_creators:src/find_creators/creators.csv - For
get_creator:src/get_creator/creator.csv
- Make sure you have Chrome installed on your system as the scraper uses ChromeDriver.
- The scraper uses Selenium in headless mode by default. To run with a visible browser, uncomment the relevant line in the
start_driver()function inutils.py.