mirror of
https://github.com/ThePhaseless/Byparr.git
synced 2026-10-05 22:04:27 +01:00
refactor: replace evaluate with locator
This commit is contained in:
committed by
ThePhaseless
parent
9afb3e0903
commit
742cafc64a
+1
-1
@@ -43,7 +43,7 @@ async def _extract_content(page: Page) -> str:
|
||||
article = trafilatura.extract(await page.content())
|
||||
if article:
|
||||
return article
|
||||
result = await page.evaluate("() => document.body ? document.body.innerText : ''")
|
||||
result = await page.locator("body").inner_text()
|
||||
return "\n".join(line.strip() for line in result.splitlines() if line.strip())
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user