From 812c83a7c5aadbb1bd7d976f265ab4ef2ddc6375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alberto=20Orejuela=20Garc=C3=ADa?= Date: Thu, 22 Aug 2019 09:58:32 +0200 Subject: [PATCH] Make scrapping more robust --- api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.py b/api.py index d8f16a6..3e55843 100644 --- a/api.py +++ b/api.py @@ -85,7 +85,7 @@ class Apod: return r.text def scrap_explanation(self, pagesource): - re_explanation = re.compile("Explanation: (.*?)

", flags=re.DOTALL) # Compile regex for extracting explanation. + re_explanation = re.compile("Explanation: (.*?)

", flags=re.DOTALL) # Compile regex for extracting explanation. explanation = re_explanation.search(pagesource).groups()[0] # Extract explanation. explanation = explanation.replace('/\n', '/') # Fix split URLs along several lines. explanation = explanation.replace('\n>', '>') # Fix split HTML tags. -- 2.45.2