From 6fa3241eae2c1da11b21f3ddf9c69b99459ea0c6 Mon Sep 17 00:00:00 2001 From: paprykdev <58005447+paprykdev@users.noreply.github.com> Date: Sun, 29 Dec 2024 14:46:26 +0100 Subject: [PATCH] fix: wait for page to load Signed-off-by: paprykdev <58005447+paprykdev@users.noreply.github.com> --- app/scripts/monet.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/scripts/monet.py b/app/scripts/monet.py index 94b1dbe..9c6748f 100644 --- a/app/scripts/monet.py +++ b/app/scripts/monet.py @@ -18,10 +18,10 @@ class MonetScraper: self.browser = await p.chromium.launch(headless=False) self.context = await self.browser.new_context() self.page = await self.context.new_page() - self.page.set_default_timeout(5000) await self.go_to(self.url) await self.skip_cookies() await self.get_hrefs() + self.page.set_default_timeout(5000) await self.get_data() self.save_data() await self.browser.close() @@ -31,9 +31,6 @@ class MonetScraper: await self.page.eval_on_selector('.button-disabled', 'el => el.removeAttribute("disabled")') await self.page.click('.button-disabled') - async def insert_value(self, selector, value): - await self.page.fill(selector, value) - async def find_el(self, selector: str): await self.wait_for_el(selector) return await self.page.query_selector(selector)