diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml index a062369..ff6e998 100644 --- a/.github/workflows/deploy-dev.yml +++ b/.github/workflows/deploy-dev.yml @@ -45,4 +45,4 @@ jobs: docker run --rm --env-file uplift.env -v ./certs:/usr/src/app/certs cornellappdev/uplift-dev:$IMAGE_TAG flask --app migrations db upgrade sudo systemctl restart nginx docker stack deploy -c docker-compose.yml the-stack --with-registry-auth - docker system prune -f + yes | docker system prune -a diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index 552b1cb..a5896cf 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -45,4 +45,4 @@ jobs: docker run --rm --env-file uplift.env -v ./certs:/usr/src/app/certs cornellappdev/uplift-prod:$IMAGE_TAG flask --app migrations db upgrade sudo systemctl restart nginx docker stack deploy -c docker-compose.yml the-stack --with-registry-auth - docker system prune -f \ No newline at end of file + yes | docker system prune -a \ No newline at end of file diff --git a/src/scrapers/equipment_scraper.py b/src/scrapers/equipment_scraper.py index c7e2b28..1504f99 100644 --- a/src/scrapers/equipment_scraper.py +++ b/src/scrapers/equipment_scraper.py @@ -104,12 +104,12 @@ def process_equip_page(page, fit_center): create_equip(equip[1], fit_center_id, fit_center) else: body = table.find_all("tr") - for even_row in range(0, len(body), 2): - muscle_groups = body[even_row].find_all("th") - equip = body[even_row + 1].find_all("td") - if muscle_groups[0].text: + header_rows = [r.find_all("th") for r in body if r.find_all("th")] + data_rows = [r.find_all("td") for r in body if r.find_all("td")] + for muscle_groups, equip in zip(header_rows, data_rows): + if len(muscle_groups) > 0 and len(equip) > 0 and muscle_groups[0].text: create_equip(equip[0], fit_center_id, fit_center) - if muscle_groups[1].text: + if len(muscle_groups) > 1 and len(equip) > 1 and muscle_groups[1].text: create_equip(equip[1], fit_center_id, fit_center)