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 1 commit
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
9 changes: 6 additions & 3 deletions skyvern/webeye/scraper/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +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 = {}
# pick up these element keys: frame, tagName, attributes, beforePseudoText, text, afterPseudoText, children
for key in ["frame", "tagName", "attributes", "beforePseudoText", "text", "afterPseudoText", "children"]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why should we keep frame attribute?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll remove.

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