TaskWeaver / executor /actions /extract_action.py
PocketSkye's picture
Initial deployment
0242ab2
Raw
History Blame Contribute Delete
397 Bytes
from executor.action_registry import (
ACTION_REGISTRY
)
async def execute(
page,
step
):
body_text = await page.locator(
"body"
).inner_text()
max_chars = step.get(
"max_chars",
12000
)
return {
"action": "extract",
"status": "success",
"data": body_text[:max_chars]
}
ACTION_REGISTRY["extract"] = execute