File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/agentlab/backends/browser Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,15 @@ def step(self, action: ToolCallAction) -> dict:
4343 }
4444
4545 def page_html (self ) -> str :
46- return ""
46+ contents = self .call_tool ("browser_evaluate" , {"function" : "document.documentElement.outerHTML" })
47+ raw_response = "\n " .join ([c .text for c in contents if c .type == "text" ])
48+ try :
49+ _ , half_response = raw_response .split ("### Result" , maxsplit = 1 )
50+ result_str , _ = half_response .split ("\n ### Ran" , maxsplit = 1 )
51+ return result_str .strip ()
52+ except Exception as e :
53+ logger .error (f"Error parsing page_html result: { e } . Raw result: { raw_response } " )
54+ return ""
4755
4856 def page_axtree (self ) -> str :
4957 contents = self .call_tool ("browser_snapshot" , {})
You can’t perform that action at this time.
0 commit comments