@@ -66,6 +66,14 @@ class StaticWebBrowserConfiguration(ApiProcessorSchema):
6666 default = [],
6767 json_schema_extra = {"advanced_parameter" : True },
6868 )
69+ extract_html : bool = Field (
70+ description = "Extract HTML" ,
71+ default = False ,
72+ )
73+ capture_screenshot : bool = Field (
74+ description = "Capture screenshot" ,
75+ default = True ,
76+ )
6977
7078
7179class StaticWebBrowserInput (ApiProcessorSchema ):
@@ -144,8 +152,8 @@ def process(self) -> dict:
144152 with WebBrowser (
145153 f"{ settings .RUNNER_HOST } :{ settings .RUNNER_PORT } " ,
146154 interactive = self ._config .stream_video ,
147- capture_screenshot = True ,
148- html = True ,
155+ capture_screenshot = self . _config . capture_screenshot ,
156+ html = self . _config . extract_html ,
149157 tags_to_extract = self ._config .tags_to_extract ,
150158 session_data = (
151159 self ._env ["connections" ][self ._config .connection_id ]["configuration" ]["_storage_state" ]
@@ -181,15 +189,11 @@ def process(self) -> dict:
181189 mime_type = "image/png" ,
182190 )
183191
184- browser_response = browser_response .model_dump ()
185- browser_response ["screenshot" ] = screenshot_asset .objref if screenshot_asset else None
192+ browser_response .screenshot = screenshot_asset .objref if screenshot_asset else None
186193
187194 async_to_sync (output_stream .write )(
188195 WebBrowserOutput (
189- text = browser_response .get (
190- "text" ,
191- "" .join (list (map (lambda x : x .get ("output" , "" ), browser_response .get ("command_outputs" , [])))),
192- ),
196+ text = browser_response .text or "" .join (list (map (lambda x : x .output , browser_response .command_outputs ))),
193197 content = browser_response ,
194198 ),
195199 )
0 commit comments