Skip to content

Commit

Permalink
fix: remove screenshot debug and add a short wait
Browse files Browse the repository at this point in the history
Signed-off-by: Eiko Wagenknecht <[email protected]>
  • Loading branch information
eikowagenknecht committed Sep 26, 2024
1 parent b081f54 commit 5dad790
Showing 1 changed file with 3 additions and 32 deletions.
35 changes: 3 additions & 32 deletions src/lootscraper/scraper/scraper_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,12 +412,6 @@ async def scroll_page_to_bottom(self, page: Page) -> None:
scolled_x_times = 0

while True:
# Take screenshot
filename = self.get_screenshot_filename(
f"debug_scroll_{str(scolled_x_times)}",
)
await page.screenshot(path=str(filename.resolve()))

# Wait to load page. We do this first to give the page time for
# the initial load
await sleep(SCROLL_PAUSE_SECONDS)
Expand All @@ -435,35 +429,12 @@ async def scroll_page_to_bottom(self, page: Page) -> None:
if scolled_x_times > 100:
break

# Wait to load page by scrolling the mouse wheel

# Take screenshot
filename = self.get_screenshot_filename(
"debug_scroll_endloop",
)
await page.screenshot(path=str(filename.resolve()))

# Wait to load page by scrolling the mouse wheel up and down again
await sleep(SCROLL_PAUSE_SECONDS)
await page.mouse.wheel(0, -100)

# Take screenshot
filename = self.get_screenshot_filename(
"debug_scroll_wheel_1",
)
await page.screenshot(path=str(filename.resolve()))

await sleep(SCROLL_PAUSE_SECONDS)
await page.mouse.wheel(0, 100)

# Take screenshot
filename = self.get_screenshot_filename(
"debug_scroll_wheel_2",
)
await page.screenshot(path=str(filename.resolve()))

# One final wait so the content may load
await sleep(SCROLL_PAUSE_SECONDS)

# Take screenshot
filename = self.get_screenshot_filename(
"debug_scroll_final",
)
await page.screenshot(path=str(filename.resolve()))

0 comments on commit 5dad790

Please sign in to comment.