From 11ca5b7250d5be67f922e8b8db5499c33ec1b299 Mon Sep 17 00:00:00 2001 From: Prakash Maheshwaran <73785492+Prakashmaheshwaran@users.noreply.github.com> Date: Thu, 26 Jun 2025 21:31:09 -0400 Subject: [PATCH] Improve listbox option selection handling by using get() method and adding a check for None (#2788) --- skyvern/webeye/actions/handler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/skyvern/webeye/actions/handler.py b/skyvern/webeye/actions/handler.py index fd7edc1c..f1383a2a 100644 --- a/skyvern/webeye/actions/handler.py +++ b/skyvern/webeye/actions/handler.py @@ -3421,7 +3421,9 @@ async def click_listbox_option( action: actions.SelectOptionAction, listbox_element_id: str, ) -> bool: - listbox_element = scraped_page.id_to_element_dict[listbox_element_id] + listbox_element = scraped_page.id_to_element_dict.get(listbox_element_id) + if listbox_element is None: + return False # this is a listbox element, get all the children if "children" not in listbox_element: return False