Skip to content

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.

License

Notifications You must be signed in to change notification settings

Reddimus/USACO_scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

USA Computing Olympiad problem scraper

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.

Released builds

You can download the released builds from the releases section of the repository.

Requirements

  1. Python3 preferably 3.11 or higher.

  2. Install third party Python libraries (beautifulsoup4, requests, customtkinter) using the text file from the repository.

    pip install -r requirements.txt

Using the scraper python script

  1. Locate the file scraper.py in src folder of the repository.

  2. Run the file using the following command:

    python3 scraper.py <usaco-website-url> --save <file-and-or-directory-path> --overwrite

    Note: that --save and overwrite are optional arguments. If --save is not provided, the problems will be saved to a file called README.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

Using the USACO scraper file with the GUI

  1. Locate the file main.py in the src folder of the repository.

  2. Run the file using the following command:

    python main.py
  3. 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 the downloads directory.

About

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.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages