mirror of
https://github.com/ThePhaseless/Byparr.git
synced 2026-11-20 05:56:33 +00:00
refactor: replace evaluate with locator
This commit is contained in:
1 parent
9afb3e0903
commit
742cafc64a
1 file changed
+1
-1
+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