Browser Actions

You may utilise browser actions while using headless browser.

Enable JavaScript rendering - "headless":"html"

Browser actions should be described under browser_actions function

Example set of browser actions

{
    "target": "universal",
    "url": "https://www.yelp.co.uk/london",
    "headless": "html",
    "browser_actions": [
        {
            "type": "input",
            "value": "pizza",
            "selector": {
                "type": "xpath",
                "value": "//input[@class='input__09f24__yaqh1 input__09f24__SFQrU original-input__09f24__C6NyQ']"
            }
        },
        {
            "type": "click",
            "selector": {
                "type": "xpath",
                "value": "//button[@class='find-near-button__09f24__cN8vv css-ggc48k']"
            }
        },
        {
            "type": "wait",
            "wait_time_s": 5
        }
    ]
}

The instructions are set to input 'pizza' into the search bar and click to search.

{
    "results": [
        {
            "content": "<HTML content here>",
            "status_code": 200,
            "url": "https://www.yelp.co.uk/london",
            "task_id": "7131940842507377665",
            "created_at": "2023-11-19 09:46:41",
            "updated_at": "2023-11-19 09:47:08"
        }
    ]
}