From b8381ca64a691125eca5d7de9c0ef4c020bc0fd7 Mon Sep 17 00:00:00 2001 From: Darrell Malone Jr Date: Sat, 19 Oct 2024 22:01:36 -0500 Subject: [PATCH] Silence Bandit warning --- scrapers/fifty_a/fifty_a/spiders/command.py | 2 +- scrapers/fifty_a/fifty_a/spiders/officer.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scrapers/fifty_a/fifty_a/spiders/command.py b/scrapers/fifty_a/fifty_a/spiders/command.py index 90be97a..045b920 100644 --- a/scrapers/fifty_a/fifty_a/spiders/command.py +++ b/scrapers/fifty_a/fifty_a/spiders/command.py @@ -22,7 +22,7 @@ def parse(self, response): commands = response.css("a.command::attr(href)").getall() logging.info(f"Found {len(commands)} units.") if self.test_mode and commands: - random.shuffle(commands) + random.shuffle(commands) # nosec commands = commands[: self.max_units] for command in commands: yield response.follow(command, self.parse_command) diff --git a/scrapers/fifty_a/fifty_a/spiders/officer.py b/scrapers/fifty_a/fifty_a/spiders/officer.py index 2ad396f..7e9bb0e 100644 --- a/scrapers/fifty_a/fifty_a/spiders/officer.py +++ b/scrapers/fifty_a/fifty_a/spiders/officer.py @@ -36,7 +36,7 @@ def __init__(self, *args, **kwargs): def parse_start_url(self, response): commands = response.css("a.command::attr(href)").getall() if self.test_mode and commands: - selected_command = random.choice(commands) + selected_command = random.choice(commands) # nosec yield response.follow(selected_command, self.parse_command) elif not self.test_mode: for command in commands: @@ -47,7 +47,7 @@ def parse_command(self, response): logging.info(f"Found {len(officer_links)} officers in {response.url}") if self.test_mode: - random.shuffle(officer_links) + random.shuffle(officer_links) # nosec officer_links = officer_links[: self.max_officers] for officer_link in officer_links: