From 510399b41a4c984a370240077a5ec18a47ecedcc Mon Sep 17 00:00:00 2001 From: Xanonymous Date: Sat, 28 Mar 2020 04:35:15 +0800 Subject: [PATCH] fix unnecessary else structure and sh file. --- crawler.py | 9 ++++----- deploy.sh | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crawler.py b/crawler.py index 0aafa3d..2fb6e90 100644 --- a/crawler.py +++ b/crawler.py @@ -88,8 +88,7 @@ def get_article_ids(page=""): data.update(dict(articles=id_list)) return data - else: - soup = BeautifulSoup(response.text, 'html.parser') - error = soup.find('title') - error_message = dict(error=error.get_text()) - return error_message + soup = BeautifulSoup(response.text, 'html.parser') + error = soup.find('title') + error_message = dict(error=error.get_text()) + return error_message diff --git a/deploy.sh b/deploy.sh index 24edc00..9639e69 100644 --- a/deploy.sh +++ b/deploy.sh @@ -1,3 +1,4 @@ +#!/bin/bash sudo pkill screen sudo pkill flask sudo rm -rf ./hey-ptt