action.get_xpath (#2642)

This commit is contained in:
Shuchang Zheng
2025-06-09 03:26:44 -07:00
committed by GitHub
parent f121ce0ce6
commit 311e641908

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)]