aboutsummaryrefslogtreecommitdiff
path: root/fetch-page
blob: 085b54e7b6d3f39fac69158e3524e5ee3981c23e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env python3
import os
import sys
import requests

for slug in sys.argv[1:]:
    url = f"https://www.portugalrunning.com/eventos/{slug}"
    page_path = os.path.join("events", slug, "page.html")
    if os.path.exists(page_path):
        continue
    response = requests.get(url)
    response.raise_for_status()
    with open(page_path, "w") as f:
        f.write(response.text)