From ed78f22f2e920c1fdbda967a93f817a7bc5781e9 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Mon, 10 Apr 2023 11:05:32 +0200 Subject: [PATCH] fix WPImport from URL --- WPImport.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/WPImport.py b/WPImport.py index d17adce..bb41e9c 100644 --- a/WPImport.py +++ b/WPImport.py @@ -15,9 +15,10 @@ class WPimport: # Public method def fromUrl(self, webpage): - for page in webpage: - r = requests.get(page) + for i in range(0, len(webpage)): + r = requests.get(webpage[i]) if r.status_code == 200: + self._logger.info("({0}/{1} : Page en cours d'import : {2}".format(i+1, len(webpage), webpage[i])) soup = BeautifulSoup(r.content, self._parser) articlebody = soup.find_all("div", class_="articlebody") if len(articlebody) > 0: