MCPcopy Create free account
hub / github.com/THUDM/AutoWebGLM / get_observation

Function get_observation

webarena/scripts/collect_obs.py:28–48  ·  view source on GitHub ↗
(
    observation_type: str, current_viewport_only: bool
)

Source from the content-addressed store, hash-verified

26
27
28def get_observation(
29 observation_type: str, current_viewport_only: bool
30) -> None:
31 env = ScriptBrowserEnv(
32 observation_type=observation_type,
33 current_viewport_only=current_viewport_only,
34 headless=HEADLESS,
35 sleep_after_execution=2.0,
36 )
37 env.reset(options={"config_file": f"scripts/tmp_storage_state.json"})
38 s = f"""page.goto("http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:7780/admin/admin/dashboard/")
39 page.get_by_label("", exact=True).fill("reviews")
40 page.get_by_label("", exact=True).press("Enter")
41 page.scroll(down)"""
42 action_seq = s.split("\n")
43
44 for action in action_seq:
45 action = action.strip()
46 obs, success, _, _, info = env.step(create_playwright_action(action))
47 print(obs["text"])
48 _ = input("Press enter to continue")
49
50
51if __name__ == "__main__":

Callers 1

collect_obs.pyFile · 0.85

Calls 4

resetMethod · 0.95
stepMethod · 0.95
ScriptBrowserEnvClass · 0.90
create_playwright_actionFunction · 0.90

Tested by

no test coverage detected