This script is made in python, which uses the selenium webdriver to scrape a player's competitive rank information from csgostats.
The script can be used in two ways:
- You can get a player's Steam profile name, current rank icon URL, best rank icon URL for using in your discord/TG/etc bots.
OR
- You can just get the current and best ranks information in plain-text for local usage.
- Install the required libs:
pip install -r requirements.txt
- Download the suitable webdriver according to your browser and version.
- Write the full path to the webdriver binary in
driver_path.txt
.
- To run:
python rank_scrape.py
You can use it in your Discord or other bots by loading it as a module like this:
import rank_scrape
scraper = rank_scrape.rank_scraper(MODE=0,URL=steam_profile_url_here)
player_name, player_avatar_url current_rank_icon_url, best_rank_icon_url = scraper.run()
You will get the player's steam profile name, avatar image URL, current rank's icon URL, best rank's icon URL.