diff --git a/litewebagent/agents/SearchAgents/PromptSearchAgent.py b/litewebagent/agents/SearchAgents/PromptSearchAgent.py index 3d2577a..0b25ee9 100644 --- a/litewebagent/agents/SearchAgents/PromptSearchAgent.py +++ b/litewebagent/agents/SearchAgents/PromptSearchAgent.py @@ -123,6 +123,7 @@ def bfs(self): "status": "pending", "depth": depth, } + logger.info(trajectory_record) self.trajectories.append(trajectory_record) try: diff --git a/litewebagent/utils/replay.py b/litewebagent/utils/replay.py index 89dcec5..0144c1b 100644 --- a/litewebagent/utils/replay.py +++ b/litewebagent/utils/replay.py @@ -132,7 +132,10 @@ def take_action(step, playwright_manager, is_replay, log_folder): _post_extract(page) url = page.url element = find_matching_element(interactive_elements, step) - action = replace_number(step["action"], element['bid']) + if element: + action = replace_number(step["action"], element['bid']) + else: + action = step["action"] code, function_calls = action_set.to_python_code(action) logger.info("Executing action script") if is_replay: