Skip to content

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

fix comment

Weixing Chen (from Dev Box)b8215de46b94
diff --git a/browser_use/agent/views.py b/browser_use/agent/views.py
index cd2403bb2..1cec01f55 100644
--- a/browser_use/agent/views.py
+++ b/browser_use/agent/views.py
@@ -166,7 +166,7 @@ class AgentHistory(BaseModel):
elements = []
for action in model_output.action:
index = action.get_index()
- if index != None and index in selector_map:
+ if index is not None and index in selector_map:
el: DOMElementNode = selector_map[index]
elements.append(HistoryTreeProcessor.convert_dom_element_to_history_element(el))
else: