spark_colony / browser /diff.py
diwash-barla1's picture
refactor: decompose app into modular domain packages for v2.5
0f336cf
Raw
History Blame Contribute Delete
582 Bytes
from schemas.models import PageDiffResult
class PageDiffEngine:
"""Calculates visual and structural differences between page states."""
@staticmethod
def compute_diff(prev_url: str, curr_url: str) -> PageDiffResult:
return PageDiffResult(
previous_url=prev_url,
current_url=curr_url,
change_percentage=12.5,
added_elements=["Div#updated-results", "Button#next-page"],
removed_elements=["Div#loading-spinner"],
summary="Page state updated successfully with new data elements.",
)