File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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(
5757 page
5858 and logger
5959 and backend_node_id is not None
60- and node_role in ("generic" , "none" )
60+ and node_role in ("generic" , "combobox" , " none" )
6161 ):
6262 try :
6363 resolved_node = await page .send_cdp (
@@ -78,6 +78,8 @@ async def _clean_structural_nodes(
7878 )
7979 result_value = tag_name_result .get ("result" , {}).get ("value" )
8080 if result_value :
81+ if node_role == "combobox" and result_value == "select" :
82+ result_value = "select"
8183 node ["role" ] = result_value
8284 node_role = result_value
8385 except Exception as tag_name_error :
@@ -98,7 +100,7 @@ async def _clean_structural_nodes(
98100 # Rename `combobox` to `select` as they are functionally equivalent.
99101 if node_role == "combobox" :
100102 node_role = "select"
101- node [' role' ] = node_role
103+ node [" role" ] = node_role
102104
103105 # Remove redundant StaticText children
104106 cleaned_children = _remove_redundant_static_text_children (node , cleaned_children )
You can’t perform that action at this time.
0 commit comments