From a31956531aced4555f983af80b459beb7d2b81c5 Mon Sep 17 00:00:00 2001 From: Jan Lukas Gernert Date: Thu, 22 Jun 2023 00:15:57 +0200 Subject: [PATCH] fix download loop --- article_scraper/src/full_text_parser/mod.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/article_scraper/src/full_text_parser/mod.rs b/article_scraper/src/full_text_parser/mod.rs index 53b8b92..ae3819d 100644 --- a/article_scraper/src/full_text_parser/mod.rs +++ b/article_scraper/src/full_text_parser/mod.rs @@ -157,12 +157,9 @@ impl FullTextParser { while let Ok(page_result) = self.evlauate_page(&html, config, global_config, article_url) { if let Page::Single(single_page_url) = page_result { - if pages.is_empty() { - pages.push( - Self::download(&single_page_url, client, config, global_config).await?, - ); - return Ok(pages); - } + let single_page_html = + Self::download(&single_page_url, client, config, global_config).await?; + return Ok(vec![single_page_html]); } else if let Page::Multi(next_page_url) = page_result { if let Some(next_page_url) = next_page_url { let next_page_html =