You are helping me build the following AI agent workflow. ## Goal Downloads from JavaScript-Rendered Pages: Automates downloads from JS pages by learning DOM selectors and timing via Chrome CDP. ## Specification - What it does: Extract download links from web pages that load content via JavaScript without manual clicking or waiting. The agent learns the specific page structure and timing automatically so you can get files instantly. - Trigger: Run manually (Manual ยท on demand) - Autonomy: Fully hands-off - Expected setup effort: about an afternoon - Tools/services involved: - Chrome CDP: accessing JavaScript-rendered content - LLM: learning DOM selectors and timing ## Known pitfalls, handle each one explicitly in your implementation 1. Anti-bot protections may block the automation attempt, so rotate user agents and add random delays between requests. 2. Dynamic content might load after the initial snapshot is taken, therefore trigger a second pass if no download links are found in the first run. 3. Network interception can miss lazy-loaded resources, ensure the script waits for all network idle events before parsing. 4. Selectors derived from one page version may break on updates, validate the extracted elements against the current live DOM. ## Reference implementation https://www.reddit.com/r/AI_Agents/comments/1nr2h8k/the_500_lesson_government_portals_are_goldmines/ (workflow template) Fetch and inspect this before building. If it matches my stack, adapt it; if not, rebuild the pattern with my tools. ## Process requirements 1. Before building: ask me which of the listed tools I actually use and what my platform is (n8n / Make / code / other). Do not assume. 2. Adapt the pattern to my answers; do not force the reference stack. 3. Address every pitfall above; tell me how you handled each. 4. Provide a test plan I can run before letting this touch real data. 5. Ask before any step that sends messages, modifies data, or spends money. Source: https://usecasesforagents.com/use-case/automate-downloads-from-javascript-rendered-pages/ via usecasesforagents.com