| 296 | |
| 297 | # auxiliary function to extract coordinates |
| 298 | def extract_coords(s): |
| 299 | # directly find and extract the coordinates in the parentheses |
| 300 | first_bracket = s.find("(") |
| 301 | start = s.find("(", first_bracket + 1) |
| 302 | end = s.find(")") |
| 303 | if start != -1 and end != -1: |
| 304 | coords_str = s[start+1:end].strip() # extract the content in (x,y) |
| 305 | x, y = coords_str.split(",") |
| 306 | return [int(x), int(y)] |
| 307 | raise ValueError(f"Cannot find coordinates in the string: {s}") |
| 308 | |
| 309 | if "click(" in action_str: |
| 310 | result["POINT"] = extract_coords(action_str) |