@@ -66,6 +66,14 @@ class StaticWebBrowserConfiguration(ApiProcessorSchema):
66
66
default = [],
67
67
json_schema_extra = {"advanced_parameter" : True },
68
68
)
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
+ )
69
77
70
78
71
79
class StaticWebBrowserInput (ApiProcessorSchema ):
@@ -144,8 +152,8 @@ def process(self) -> dict:
144
152
with WebBrowser (
145
153
f"{ settings .RUNNER_HOST } :{ settings .RUNNER_PORT } " ,
146
154
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 ,
149
157
tags_to_extract = self ._config .tags_to_extract ,
150
158
session_data = (
151
159
self ._env ["connections" ][self ._config .connection_id ]["configuration" ]["_storage_state" ]
@@ -181,15 +189,11 @@ def process(self) -> dict:
181
189
mime_type = "image/png" ,
182
190
)
183
191
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
186
193
187
194
async_to_sync (output_stream .write )(
188
195
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 ))),
193
197
content = browser_response ,
194
198
),
195
199
)
0 commit comments