This is a simple program that scrapes problems from the USA Computing Olympiad website and saves them to a local directory. The program is written in Python and uses the BeautifulSoup library to parse the HTML of the website.
You can download the released builds from the releases section of the repository.
-
Python3 preferably 3.11 or higher.
-
Install third party Python libraries (
beautifulsoup4
,requests
,customtkinter
) using the text file from the repository.pip install -r requirements.txt
-
Locate the file
scraper.py
insrc
folder of the repository. -
Run the file using the following command:
python3 scraper.py <usaco-website-url> --save <file-and-or-directory-path> --overwrite
Note: that
--save
andoverwrite
are optional arguments. If--save
is not provided, the problems will be saved to a file calledREADME.md
in the repository folder. While--overwrite
is a flag that will overwrite the file if it already exists.Example 1:
python3 scraper.py "https://usaco.org/index.php?page=viewproblem2&cpid=810" --save "Test"
Example 2:
python3 scraper.py "https://usaco.org/index.php?page=viewproblem2&cpid=1422" --save "C:\\Program Files\\Test.md" --overwrite
-
Locate the file
main.py
in thesrc
folder of the repository. -
Run the file using the following command:
python main.py
-
A GUI window will open up. Enter the USACO website URL and click on the "Scrape" button. Optionally, select the directory where you want to save the problems; by default, the problems will be saved to a file called
README.md
in thedownloads
directory.