From 3ff4d2918f48ba27247b4be7908ffa6ec6e939e4 Mon Sep 17 00:00:00 2001 From: Manuel Eusebio de Paz Carmona Date: Sat, 15 Jan 2022 22:55:22 +0100 Subject: [PATCH] FIX Thanks to @imirkin --- README.md | 2 +- vgchartz-full-crawler.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 40aae9d..4db384b 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ It can be installed by pip. $> pip install -r requirements.txt # Run - $> python vgchartzfull.py + $> python vgchartz-full-crawler.py ``` diff --git a/vgchartz-full-crawler.py b/vgchartz-full-crawler.py index 7c6c30c..2aad95b 100644 --- a/vgchartz-full-crawler.py +++ b/vgchartz-full-crawler.py @@ -186,11 +186,11 @@ def download_data(*, start_page, end_page, include_genre): # We locate the game through search tags with game urls in the main table game_tags = list(filter( - lambda x: x.attrs['href'].startswith('https://www.vgchartz.com/game/'), + lambda x: 'href' in x.attrs and x.attrs['href'].startswith('https://www.vgchartz.com/game/'), # discard the first 10 elements because those # links are in the navigation bar soup.find_all("a") - ))[10:] + )) for tag in game_tags: