Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update element hashing logic - subscribe only. otherwise, any element update would break element hashing #1784

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions skyvern/webeye/scraper/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,12 @@ def json_to_html(element: dict, need_skyvern_attrs: bool = True) -> str:


def clean_element_before_hashing(element: dict) -> dict:
element_copy = copy.deepcopy(element)
element_copy.pop("id", None)
element_copy.pop("rect", None)
element_copy.pop("frame_index", None)
element_copy = {}
# pick up these element keys: frame, tagName, attributes, beforePseudoText, text, afterPseudoText, children
for key in ["tagName", "attributes", "beforePseudoText", "text", "afterPseudoText", "children"]:
if key not in element:
continue
element_copy[key] = copy.deepcopy(element[key])
if "attributes" in element_copy:
element_copy["attributes"].pop(SKYVERN_ID_ATTR, None)
if "children" in element_copy:
Expand Down
Loading