action.get_xpath (#2642)
Some checks failed
Run tests and pre-commit / Run tests and pre-commit hooks (push) Waiting to run
Run tests and pre-commit / Frontend Lint and Build (push) Waiting to run
Publish Fern Docs / run (push) Waiting to run
Sync to skyvern-cloud / sync (push) Waiting to run
Run n8n package CI / test (push) Has been cancelled

This commit is contained in:
Shuchang Zheng 2025-06-09 03:26:44 -07:00 committed by GitHub
parent f121ce0ce6
commit 311e641908
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -168,6 +168,13 @@ class Action(BaseModel):
else:
raise ValueError("Invalid action data")
def get_xpath(self) -> str | None:
if not self.skyvern_element_data:
return None
if "xpath" in self.skyvern_element_data:
return self.skyvern_element_data["xpath"]
return None
class WebAction(Action):
element_id: Annotated[str, Field(coerce_numbers_to_str=True)]