Skip to content

A simple scraper made in python for the purpose of downloading codeforce contests and problems as pdf It allows downloading problem based on contest id, rating, difficulty and tags

Notifications You must be signed in to change notification settings

Bishalsarang/Codeforces-Scraper

Repository files navigation

Codeforce-Scraper

A simple scrapper made in python for the purpose of downloading codeforce contests and problems as pdf
It allows downloading problem based on contest id, rating, difficulty adn tags Sample PDF for CF Beta Round 13

You can download pdfs from all codeforces contest currently upto Codeforces Round #542 from here

Requirements:

  1. wkhtmltopdf
  2. pdfkit
  3. requests
  4. bs4

Install Dependencies:

pip install requests
pip install pdfkit
pip install wkhtmltopdf
pip install bs4

Usage:

  1. Show help
python scrapper.py -h
  1. Download contest problem from certain contest id 300 upto contest id 302
    View help to know what switch -m, -l and -c are
python scrapper.py -m contest -l 300 -u 302
  1. Download problems with rating 1200-1300 order by solved
python scrapper.py -m p  -t 1200-1300 -o solved 
  1. Download problems with tag dp
python scrapper.py -m p -t dp
  1. Download problems with tag dp and binary search ordered by solved
    Note: Enclose tags inside quotes if it is more than 1 word
python scrapper.py -m p -t dp -o solved
python scrapper.py -m p -t "binary search" -o solved
  1. Download all problems with tag dp ordered by rating
python scrapper.py -m p -t dp -o rating
  1. Download all problems with tag dp ordered by solved in ascending order
    Change to -asc False to download in descending order
python scrapper.py -m p -t dp -o solved -asc True
  1. Download maximum of 10 problems with tag dp ordered by solved in ascending order
python scrapper.py -m p -t dp -o solved -asc True -n 10
  1. Download maximum of 10 problems with any tag ordered by solved in ascending order
python scrapper.py -m p  -o solved -asc True -n 10
  1. Download maximum of 10 problems with any tag ordered by rating in ascending order
python scrapper.py -m p  -o rating -asc True -n 10

Note: Combine switches similarly as per your convenience to download problems based on your query

Note for Windows Users:

Download wkhtmltopdf executable from here and set the path path of executable in scrapper.py file accordingly by updating path_wkhtmlpdf to path of wkhtmltopdf.exe

Config

Updates:

  1. Feature to download contest based on contest ID
  2. Feature to download problemset base on ratings, tags (In progress)

Screenshots

Screenshots


Screenshots


Screenshots

About

A simple scraper made in python for the purpose of downloading codeforce contests and problems as pdf It allows downloading problem based on contest id, rating, difficulty and tags

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages