| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <title>Crawler Test - Infinite Loop</title> |
| <style> |
| body { |
| font-family: Arial, sans-serif; |
| margin: 0; |
| padding: 20px; |
| background: #f0f0f0; |
| } |
| .page { |
| max-width: 800px; |
| margin: 0 auto; |
| background: white; |
| padding: 20px; |
| border-radius: 8px; |
| box-shadow: 0 2px 4px rgba(0,0,0,0.1); |
| } |
| .navigation { |
| margin-top: 20px; |
| padding: 10px; |
| background: #f8f8f8; |
| border-radius: 4px; |
| } |
| a { |
| color: #0066cc; |
| text-decoration: none; |
| padding: 5px 10px; |
| margin-right: 10px; |
| border: 1px solid #0066cc; |
| border-radius: 4px; |
| display: inline-block; |
| } |
| a:hover { |
| background: #0066cc; |
| color: white; |
| } |
| </style> |
| </head> |
| <body> |
| <div id="content"></div> |
|
|
| <script> |
| |
| const pages = { |
| 'home': { |
| title: 'Home Page', |
| content: '<p>Welcome to the crawler test page.</p>', |
| links: [ |
| { text: 'Go to Loop 1', href: '?page=loop1' }, |
| ] |
| }, |
| 'loop1': { |
| title: 'Loop Page 1', |
| content: '<p>This is loop page 1.</p>', |
| links: [ |
| { text: 'Back to Home', href: '?page=home' }, |
| { text: 'Go to Loop 2', href: '?page=loop2' }, |
| ] |
| }, |
| 'loop2': { |
| title: 'Loop Page 2', |
| content: ` |
| <p>This is loop page 2 with some dummy text.</p> |
| <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. |
| Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> |
| <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris |
| nisi ut aliquip ex ea commodo consequat.</p> |
| `, |
| links: [ |
| { text: 'Back to Loop 1', href: '?page=loop1' }, |
| { text: 'Back to Home', href: '?page=home' }, |
| ] |
| } |
| }; |
| |
| |
| const urlParams = new URLSearchParams(window.location.search); |
| const currentPage = urlParams.get('page') || 'home'; |
| |
| |
| const content = document.getElementById('content'); |
| const page = pages[currentPage] || pages['home']; |
| |
| content.innerHTML = ` |
| <div class="page"> |
| <h1>${page.title}</h1> |
| ${page.content} |
| <div class="navigation"> |
| ${page.links.map(link => |
| `<a href="${link.href}">${link.text}</a>` |
| ).join('')} |
| </div> |
| </div> |
| `; |
| </script> |
| </body> |
| </html> |