evaluation.benchmarks.the_agent_company.browsing
Selector Objects
@dataclass
class Selector()
Represents either a direct anchor ID or a descriptive selector
BrowserAction Objects
@dataclass
class BrowserAction()
Base class for all browser actions
to_instruction
def to_instruction() -> str
Convert the action to a browser instruction string
parse_content_to_elements
def parse_content_to_elements(content: str) -> Dict[str, str]
Parse the observation content into a dictionary mapping anchors to their descriptions
find_matching_anchor
def find_matching_anchor(content: str, selector: str) -> Optional[str]
Find the anchor ID that matches the given selector description
resolve_action
def resolve_action(action: BrowserAction, content: str) -> BrowserAction
Resolve any descriptive selectors in the action to anchor IDs based on the content. Returns a new action with resolved selectors.
pre_login
def pre_login(runtime: Runtime,
services: List[str],
save_screenshots=True,
screenshots_dir='screenshots')
Logs in to all the websites that are needed for the evaluation. Once logged in, the sessions would be cached in the browser, so OpenHands agent doesn't need to log in to these websites again.