Skip to main content

Working with JavaScript-rendered content

Browse AI's Robot Studio executes JavaScript during both training and extraction, allowing you to capture data from dynamic websites just like a regular browser would.

M
Written by Melissa Shires
Updated this week

Websites use JavaScript to dynamically load and render content. Browse AI's Robot Studio executes JavaScript during both training and extraction, allowing you to capture data from dynamic websites just like a regular browser would.

Understanding JavaScript-rendered content

  • Server-side rendered: traditional HTML sent complete from server (instant content).

  • Client-side rendered: JavaScript builds the page in your browser (React, Vue, Angular sites).

  • Dynamically loaded: content fetched via AJAX/API calls after page load.

  • Progressive enhancement: basic HTML enhanced with JavaScript for interactivity.

Browse AI handles all these types by running JavaScript during extraction, just like when you trained your robot.

How Browse AI handles JavaScript

Automatic JavaScript execution

When your robot visits a page:

  1. The page loads in Browse AI's browser environment

  2. JavaScript executes automatically

  3. Dynamic content renders

  4. Robot waits for content to appear

  5. Extraction happens after rendering completes

You don't need to do anything special - if content appears when you visit the page normally, the robot can extract it.

Training with dynamic content

During training in Robot Studio:

  1. Wait for content to load before capturing (and scroll if needed)

  2. The page should look complete before you interact

  3. Your clicks, and scrolls teach the robot when the content is ready

Common JavaScript content patterns

AJAX-loaded content

Content that loads after the initial page:

  1. Navigate to the page

  2. Wait for the content to appear (spinner disappears, data shows)

  3. Capture the loaded content

  4. Robot learns to wait for AJAX completion

Single Page Applications (SPAs)

Sites that don't reload when navigating:

  1. Click navigation elements as normal

  2. Wait for new content to render

  3. URL may change without page reload

  4. Capture data after transitions complete

  5. Robot handles SPA navigation naturally

Lazy-loaded images and media

Images that load as you scroll:

  1. Scroll to where images should appear

  2. Wait for them to load (placeholders replaced)

  3. Capture screenshots if needed

  4. Robot replicates scroll-and-wait pattern

Real-time updating content

Content that updates without interaction (stock prices, scores):

  1. Wait for initial values to load

  2. Capture at a specific moment

  3. Robot captures whatever is present at extraction time

  4. Use monitoring for regular updates

Best practices for JavaScript sites

Allow sufficient loading time

During training:

  • Don't rush - let everything load

  • Watch for loading indicators (spinners, progress bars)

  • Wait until numbers/text stop changing

  • Give complex apps 3-5 seconds to stabilize

Signs content is ready:

  • Loading spinners disappear

  • Placeholder text is replaced

  • Images have loaded

  • Animations have completed

  • Data tables are populated

Handle loading states

Many JavaScript apps show loading states:

  1. Skeleton screens: Gray boxes that become content

  2. Spinners: Rotating indicators

  3. Progress bars: Show loading percentage

  4. "Loading..." text: Placeholder messages

Always wait for these to disappear before capturing data.

Content that requires interaction

Some JavaScript content needs mouse movement or focus:

  1. Click into input fields to trigger validation

  2. Click tabs to load panel content

  3. Scroll to trigger lazy loading

  4. Robot learns these interactions

Advanced JavaScript scenarios

Infinite scroll with JavaScript

JavaScript-powered forms

Forms with dynamic validation and submission:

  1. Fill fields (may trigger JavaScript validation)

  2. Wait for validation messages

  3. Submit triggers JavaScript

  4. Wait for response to render

  5. Capture success/error messages

WebSocket or real-time data

Content updating via WebSocket connections:

  • Robot captures current state when it runs

  • Cannot wait for specific values

  • Use monitoring for regular snapshots

  • Good for dashboards, live feeds

Canvas and WebGL content

Graphics rendered via JavaScript:

  • Can screenshot but not extract as text

  • Charts/graphs often use Canvas

  • 3D content uses WebGL

  • Capture as images when needed

Performance optimization

Reduce JavaScript execution time

For faster extraction:

  • Avoid unnecessary interactions

  • Don't trigger animations unless needed

  • Skip optional JavaScript features

  • Focus on essential data

Handle heavy JavaScript sites

For complex applications:

  • Break extraction into smaller tasks

  • Use multiple robots for different sections

  • Allow extra time for full render

  • Monitor success rates

When JavaScript content won't load

Check basic requirements

  1. Does the site load in a normal browser?

  2. Are there console errors?

  3. Does it require special permissions?

  4. Is JavaScript actually the issue?

Alternative approaches

If JavaScript content remains problematic:

  • Look for non-JavaScript version (mobile site?)

  • Check if data is in page source (view source)

  • Consider API access if available

  • Contact support for specific sites

Work with API-powered sites

Sites that fetch data from APIs:

  1. The page structure loads first (empty)

  2. JavaScript requests data from API

  3. Data populates into the structure

  4. Wait for data, not just structure

Troubleshooting JavaScript issues

Content not appearing during extraction

  • Not waiting long enough for JavaScript to run

  • Site requires specific browser features

  • JavaScript errors preventing render

Solutions:

  • Retrain with different interaction patterns

  • Check if site works in regular browser

Partial content loading

  • Some data appears, some doesn't

  • Random missing elements

  • Inconsistent extractions

Solutions:

  • Increase wait times during training

  • Check for sequential loading (wait for all stages)

  • Verify no JavaScript errors in console

Did this answer your question?