From 38e15c10fab03def188cb81dba81b4e7b623b618 Mon Sep 17 00:00:00 2001 From: Ilia Miheev Date: Sat, 17 May 2025 15:31:47 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20timeSleep=20=D0=B4=D0=BB=D1=8F=20get=5Fdinamic=5Fpage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ipars/module.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ipars/module.py b/ipars/module.py index d98d192..10ee815 100644 --- a/ipars/module.py +++ b/ipars/module.py @@ -109,7 +109,7 @@ class Pars: raise RuntimeError(e) from e - def get_dinamic_page(self, url, pathToSaveFile, closeWindow:bool=1) -> None: + def get_dinamic_page(self, url, pathToSaveFile, closeWindow:bool=1, timeSleep:int=2) -> None: '''Получаем динамическую страницу''' # Устанавливаем опции для Chrome WebDriver @@ -126,7 +126,7 @@ class Pars: # Прокручиваем до низа страницы driver.execute_script("window.scrollTo(0, document.body.scrollHeight);") # Ждем загрузки страницы - sleep(2) + sleep(timeSleep) # Вычисляем новую высоту страницы new_height = driver.execute_script("return document.body.scrollHeight") if new_height == last_height: