File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " stagehand " : patch
3
+ ---
4
+
5
+ Add support for handling OS-level dropdowns
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ async def _clean_structural_nodes(
57
57
page
58
58
and logger
59
59
and backend_node_id is not None
60
- and node_role in ("generic" , "none" )
60
+ and node_role in ("generic" , "combobox" , " none" )
61
61
):
62
62
try :
63
63
resolved_node = await page .send_cdp (
@@ -78,6 +78,8 @@ async def _clean_structural_nodes(
78
78
)
79
79
result_value = tag_name_result .get ("result" , {}).get ("value" )
80
80
if result_value :
81
+ if node_role == "combobox" and result_value == "select" :
82
+ result_value = "select"
81
83
node ["role" ] = result_value
82
84
node_role = result_value
83
85
except Exception as tag_name_error :
@@ -98,7 +100,7 @@ async def _clean_structural_nodes(
98
100
# Rename `combobox` to `select` as they are functionally equivalent.
99
101
if node_role == "combobox" :
100
102
node_role = "select"
101
- node [' role' ] = node_role
103
+ node [" role" ] = node_role
102
104
103
105
# Remove redundant StaticText children
104
106
cleaned_children = _remove_redundant_static_text_children (node , cleaned_children )
You can’t perform that action at this time.
0 commit comments