docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
A utility that extracts and aggregates data from nested iframe structures on a webpage. The tool should navigate through multiple levels of iframes and collect specific information from each frame.
Build a function that accepts a page URL and extracts content from all frames (including nested iframes) within that page. The function should return a structured dataset containing information from each frame.
Your solution must:
url: String containing the target webpage URLoutputPath: String path where results should be saved as JSONThe output should be a JSON file with the following structure:
{
"mainFrame": {
"name": "main",
"url": "https://example.com/page",
"title": "Example Page",
"hasChildren": true,
"children": [
{
"name": "iframe1",
"url": "https://example.com/frame1",
"title": "Frame 1",
"hasChildren": false,
"children": []
}
]
}
}/**
* Extracts and aggregates data from all frames in a webpage
* @param {string} url - The URL of the webpage to analyze
* @param {string} outputPath - Path where the JSON result should be saved
* @returns {Promise<void>}
*/
async function aggregateFrameContent(url, outputPath) {
// IMPLEMENTATION HERE
}
module.exports = { aggregateFrameContent };Provides browser automation capabilities for navigating pages and interacting with frames.