Web Scraper Test Website

JavaScript Test Page

This page demonstrates heavy JavaScript usage to test how the screenshot service handles JavaScript-intensive pages.

Page Information

This page contains various JavaScript demonstrations that test the screenshot service's ability to render JavaScript-generated content.

DOM Manipulation

Click a button to see the result

Data Fetching

Loading data...
Click the button to fetch data

Canvas Visualization

Complex Calculations

Calculating...
Click the button to start calculation

Dynamic Styling

Theme Preview

This content will change styling based on the selected theme.

JavaScript Code Example

Here's an example of the JavaScript code used on this page:

// DOM Manipulation Example function addElements() { const container = document.getElementById('dom-container'); for (let i = 0; i < 5; i++) { const element = document.createElement('div'); element.className = 'content-item'; element.textContent = `Dynamically created element #${i+1}`; element.style.padding = '10px'; element.style.margin = '5px 0'; element.style.backgroundColor = `hsl(${i * 50}, 70%, 80%)`; container.appendChild(element); } document.getElementById('dom-output').textContent = `Added ${5} elements at ${new Date().toISOString()}`; }

Testing Instructions

When testing the screenshot service with this page:

  1. Take a screenshot with a short delay_time to capture the page before JavaScript execution.
  2. Take a screenshot with a longer delay_time to capture the page after JavaScript execution.
  3. Try interacting with the page (clicking buttons) before taking screenshots.
  4. Test with different JavaScript injection scenarios.

Sample API Requests:

POST /v1.0/screenshot
{
  "url": "http://localhost:8000/javascript",
  "delay_time": 500,
  "format": "png"
}
POST /v1.0/screenshot
{
  "url": "http://localhost:8000/javascript",
  "delay_time": 5000,
  "format": "png"
}
POST /v1.0/screenshot
{
  "url": "http://localhost:8000/javascript",
  "javascript_code": "document.getElementById('add-elements').click(); document.getElementById('apply-theme-dark').click();",
  "delay_time": 1000,
  "format": "png"
}