Skip to content

Instantly share code, notes, and snippets.

@tusqasi
Created October 16, 2023 16:13
Show Gist options
  • Save tusqasi/b6cc91481863b1bc0147b5361a9b3343 to your computer and use it in GitHub Desktop.
Save tusqasi/b6cc91481863b1bc0147b5361a9b3343 to your computer and use it in GitHub Desktop.
import requests
import multiprocessing
def get_paper_for_year(year):
data = requests.get(
f"https://gate.iitkgp.ac.in/documents/gatepapers/{year}/ec_{year}.pdf")
with open(f"/tmp/gate_paper/{year}.pdf", mode='wb') as fp:
fp.write(data.content)
pool = multiprocessing.Pool()
pool.map(get_paper_for_year,range(2002,2022))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment