Skip to content

Commit 42c366b

Browse files
authored
Merge pull request #1027 from denis-ershov/patch-1
fix: add null check for document.body when reading scrollHeight
2 parents 82fa6fd + 6c5f7bb commit 42c366b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scrapegraphai/docloaders/chromium.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ async def ascrape_playwright_scroll(
265265

266266
while True:
267267
current_height = await page.evaluate(
268-
"document.body.scrollHeight"
268+
"document.body ? document.body.scrollHeight : document.documentElement.scrollHeight"
269269
)
270270
heights.append(current_height)
271271
heights = heights[

0 commit comments

Comments
 (0)