Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

reactivate the hack for now

mertunsallb60dc35ff004
diff --git a/browser_use/tools/service.py b/browser_use/tools/service.py
index fc603a773..ac08287b8 100644
--- a/browser_use/tools/service.py
+++ b/browser_use/tools/service.py
@@ -291,16 +291,15 @@ class Tools(Generic[Context]):
error_msg = f'Failed to click element {params.index}: {str(e)}'
# If it's a select dropdown error, automatically get the dropdown options
- # comment this out for now as it should be handled properly
- # if 'dropdown' in str(e) and node:
- # try:
- # return await get_dropdown_options(
- # params=GetDropdownOptionsAction(index=params.index), browser_session=browser_session
- # )
- # except Exception as dropdown_error:
- # logger.error(
- # f'Failed to get dropdown options as shortcut during click_element_by_index on dropdown: {type(dropdown_error).__name__}: {dropdown_error}'
- # )
+ if 'dropdown' in str(e) and node:
+ try:
+ return await get_dropdown_options(
+ params=GetDropdownOptionsAction(index=params.index), browser_session=browser_session
+ )
+ except Exception as dropdown_error:
+ logger.error(
+ f'Failed to get dropdown options as shortcut during click_element_by_index on dropdown: {type(dropdown_error).__name__}: {dropdown_error}'
+ )
return ActionResult(error=error_msg)