Spaces:
Sleeping
Sleeping
Update templates/result.html
Browse files- templates/result.html +301 -7
templates/result.html
CHANGED
|
@@ -3,12 +3,306 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Scraping Results</title>
|
| 7 |
+
<style>
|
| 8 |
+
:root {
|
| 9 |
+
--navy-blue: #1a237e;
|
| 10 |
+
--light-navy: #283593;
|
| 11 |
+
--accent-blue: #3949ab;
|
| 12 |
+
--light-bg: #f5f7ff;
|
| 13 |
+
--card-bg: #ffffff;
|
| 14 |
+
--text-dark: #212121;
|
| 15 |
+
--text-light: #757575;
|
| 16 |
+
--border-color: #e0e0e0;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
* {
|
| 20 |
+
margin: 0;
|
| 21 |
+
padding: 0;
|
| 22 |
+
box-sizing: border-box;
|
| 23 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
body {
|
| 27 |
+
background-color: var(--light-bg);
|
| 28 |
+
color: var(--text-dark);
|
| 29 |
+
line-height: 1.6;
|
| 30 |
+
padding: 20px;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
.container {
|
| 34 |
+
max-width: 1200px;
|
| 35 |
+
margin: 0 auto;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
header {
|
| 39 |
+
text-align: center;
|
| 40 |
+
margin-bottom: 40px;
|
| 41 |
+
padding: 20px 0;
|
| 42 |
+
border-bottom: 1px solid var(--border-color);
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
h1 {
|
| 46 |
+
color: var(--navy-blue);
|
| 47 |
+
font-size: 2.5rem;
|
| 48 |
+
margin-bottom: 10px;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
.subtitle {
|
| 52 |
+
color: var(--text-light);
|
| 53 |
+
font-size: 1.1rem;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
.stats-bar {
|
| 57 |
+
display: flex;
|
| 58 |
+
justify-content: space-between;
|
| 59 |
+
background-color: var(--navy-blue);
|
| 60 |
+
color: white;
|
| 61 |
+
padding: 15px 20px;
|
| 62 |
+
border-radius: 8px;
|
| 63 |
+
margin-bottom: 30px;
|
| 64 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
.stats-item {
|
| 68 |
+
text-align: center;
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
.stats-value {
|
| 72 |
+
font-size: 1.8rem;
|
| 73 |
+
font-weight: bold;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
.stats-label {
|
| 77 |
+
font-size: 0.9rem;
|
| 78 |
+
opacity: 0.8;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
.results-container {
|
| 82 |
+
display: grid;
|
| 83 |
+
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
| 84 |
+
gap: 20px;
|
| 85 |
+
margin-bottom: 40px;
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
.result-card {
|
| 89 |
+
background-color: var(--card-bg);
|
| 90 |
+
border-radius: 10px;
|
| 91 |
+
padding: 20px;
|
| 92 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
|
| 93 |
+
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
| 94 |
+
border-left: 4px solid var(--accent-blue);
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
.result-card:hover {
|
| 98 |
+
transform: translateY(-5px);
|
| 99 |
+
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
.card-header {
|
| 103 |
+
display: flex;
|
| 104 |
+
justify-content: space-between;
|
| 105 |
+
align-items: center;
|
| 106 |
+
margin-bottom: 15px;
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
.card-index {
|
| 110 |
+
background-color: var(--light-navy);
|
| 111 |
+
color: white;
|
| 112 |
+
width: 30px;
|
| 113 |
+
height: 30px;
|
| 114 |
+
border-radius: 50%;
|
| 115 |
+
display: flex;
|
| 116 |
+
align-items: center;
|
| 117 |
+
justify-content: center;
|
| 118 |
+
font-weight: bold;
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
.card-title {
|
| 122 |
+
font-size: 1.2rem;
|
| 123 |
+
color: var(--navy-blue);
|
| 124 |
+
margin-bottom: 10px;
|
| 125 |
+
line-height: 1.4;
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
.card-meta {
|
| 129 |
+
display: flex;
|
| 130 |
+
justify-content: space-between;
|
| 131 |
+
font-size: 0.85rem;
|
| 132 |
+
color: var(--text-light);
|
| 133 |
+
margin-top: 15px;
|
| 134 |
+
padding-top: 10px;
|
| 135 |
+
border-top: 1px solid var(--border-color);
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
.actions {
|
| 139 |
+
display: flex;
|
| 140 |
+
justify-content: center;
|
| 141 |
+
gap: 15px;
|
| 142 |
+
margin-top: 30px;
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
.btn {
|
| 146 |
+
padding: 12px 25px;
|
| 147 |
+
border: none;
|
| 148 |
+
border-radius: 6px;
|
| 149 |
+
font-weight: 600;
|
| 150 |
+
cursor: pointer;
|
| 151 |
+
transition: all 0.3s ease;
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
.btn-primary {
|
| 155 |
+
background-color: var(--navy-blue);
|
| 156 |
+
color: white;
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
.btn-primary:hover {
|
| 160 |
+
background-color: var(--light-navy);
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
.btn-secondary {
|
| 164 |
+
background-color: transparent;
|
| 165 |
+
color: var(--navy-blue);
|
| 166 |
+
border: 1px solid var(--navy-blue);
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
.btn-secondary:hover {
|
| 170 |
+
background-color: rgba(26, 35, 126, 0.1);
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
footer {
|
| 174 |
+
text-align: center;
|
| 175 |
+
margin-top: 50px;
|
| 176 |
+
padding: 20px 0;
|
| 177 |
+
color: var(--text-light);
|
| 178 |
+
font-size: 0.9rem;
|
| 179 |
+
border-top: 1px solid var(--border-color);
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
@media (max-width: 768px) {
|
| 183 |
+
.results-container {
|
| 184 |
+
grid-template-columns: 1fr;
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
.stats-bar {
|
| 188 |
+
flex-direction: column;
|
| 189 |
+
gap: 15px;
|
| 190 |
+
}
|
| 191 |
+
}
|
| 192 |
+
</style>
|
| 193 |
</head>
|
| 194 |
<body>
|
| 195 |
+
<div class="container">
|
| 196 |
+
<header>
|
| 197 |
+
<h1>Web Scraping Results</h1>
|
| 198 |
+
<p class="subtitle">Extracted content from your target websites</p>
|
| 199 |
+
</header>
|
| 200 |
+
|
| 201 |
+
<div class="stats-bar">
|
| 202 |
+
<div class="stats-item">
|
| 203 |
+
<div class="stats-value" id="total-results">24</div>
|
| 204 |
+
<div class="stats-label">Total Results</div>
|
| 205 |
+
</div>
|
| 206 |
+
<div class="stats-item">
|
| 207 |
+
<div class="stats-value" id="success-rate">98%</div>
|
| 208 |
+
<div class="stats-label">Success Rate</div>
|
| 209 |
+
</div>
|
| 210 |
+
<div class="stats-item">
|
| 211 |
+
<div class="stats-value" id="scraping-time">3.2s</div>
|
| 212 |
+
<div class="stats-label">Scraping Time</div>
|
| 213 |
+
</div>
|
| 214 |
+
</div>
|
| 215 |
+
|
| 216 |
+
<div class="results-container" id="results-container">
|
| 217 |
+
<!-- Results will be dynamically inserted here -->
|
| 218 |
+
</div>
|
| 219 |
+
|
| 220 |
+
<div class="actions">
|
| 221 |
+
<button class="btn btn-primary" id="export-btn">Export Results</button>
|
| 222 |
+
<button class="btn btn-secondary" id="new-scrape-btn">New Scraping Job</button>
|
| 223 |
+
</div>
|
| 224 |
+
|
| 225 |
+
<footer>
|
| 226 |
+
<p>Web Scraping Tool © 2023 | All rights reserved</p>
|
| 227 |
+
</footer>
|
| 228 |
+
</div>
|
| 229 |
+
|
| 230 |
+
<script>
|
| 231 |
+
// Sample data - replace with your actual scraping results
|
| 232 |
+
const scrapedTitles = [
|
| 233 |
+
"The Future of Artificial Intelligence in Healthcare",
|
| 234 |
+
"How to Build a Successful E-commerce Business in 2023",
|
| 235 |
+
"Understanding Blockchain Technology and Its Applications",
|
| 236 |
+
"10 Tips for Improving Your Website's SEO Performance",
|
| 237 |
+
"The Impact of Climate Change on Global Agriculture",
|
| 238 |
+
"Machine Learning Algorithms Every Developer Should Know",
|
| 239 |
+
"Cybersecurity Best Practices for Small Businesses",
|
| 240 |
+
"The Rise of Remote Work: Challenges and Opportunities",
|
| 241 |
+
"Sustainable Energy Solutions for Urban Environments",
|
| 242 |
+
"Data Visualization Techniques for Better Business Insights",
|
| 243 |
+
"The Psychology of User Experience Design",
|
| 244 |
+
"Cloud Computing: Benefits and Implementation Strategies",
|
| 245 |
+
"Digital Marketing Trends That Will Dominate 2024",
|
| 246 |
+
"The Ethics of AI: Balancing Innovation and Responsibility",
|
| 247 |
+
"Mobile App Development: Native vs Hybrid Approaches",
|
| 248 |
+
"Internet of Things: Connecting Our World Smarter",
|
| 249 |
+
"The Evolution of Programming Languages",
|
| 250 |
+
"Big Data Analytics: Transforming Business Intelligence",
|
| 251 |
+
"Virtual Reality and Its Applications Beyond Gaming",
|
| 252 |
+
"The Importance of Digital Literacy in Modern Education",
|
| 253 |
+
"5G Technology: What It Means for Connectivity",
|
| 254 |
+
"Automation in Manufacturing: Industry 4.0 Revolution",
|
| 255 |
+
"The Role of Chatbots in Customer Service",
|
| 256 |
+
"Privacy Concerns in the Age of Social Media"
|
| 257 |
+
];
|
| 258 |
+
|
| 259 |
+
// Function to render the results
|
| 260 |
+
function renderResults() {
|
| 261 |
+
const container = document.getElementById('results-container');
|
| 262 |
+
container.innerHTML = '';
|
| 263 |
+
|
| 264 |
+
scrapedTitles.forEach((title, index) => {
|
| 265 |
+
const card = document.createElement('div');
|
| 266 |
+
card.className = 'result-card';
|
| 267 |
+
|
| 268 |
+
// Generate a random word count for demonstration
|
| 269 |
+
const wordCount = Math.floor(Math.random() * 200) + 50;
|
| 270 |
+
|
| 271 |
+
// Generate a random date for demonstration
|
| 272 |
+
const randomDate = new Date();
|
| 273 |
+
randomDate.setDate(randomDate.getDate() - Math.floor(Math.random() * 30));
|
| 274 |
+
|
| 275 |
+
card.innerHTML = `
|
| 276 |
+
<div class="card-header">
|
| 277 |
+
<div class="card-index">${index + 1}</div>
|
| 278 |
+
</div>
|
| 279 |
+
<div class="card-title">${title}</div>
|
| 280 |
+
<div class="card-meta">
|
| 281 |
+
<span>${wordCount} words</span>
|
| 282 |
+
<span>${randomDate.toLocaleDateString()}</span>
|
| 283 |
+
</div>
|
| 284 |
+
`;
|
| 285 |
+
|
| 286 |
+
container.appendChild(card);
|
| 287 |
+
});
|
| 288 |
+
|
| 289 |
+
// Update the total results count
|
| 290 |
+
document.getElementById('total-results').textContent = scrapedTitles.length;
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
// Initialize the page
|
| 294 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 295 |
+
renderResults();
|
| 296 |
+
|
| 297 |
+
// Add event listeners for buttons
|
| 298 |
+
document.getElementById('export-btn').addEventListener('click', function() {
|
| 299 |
+
alert('Export functionality would be implemented here!');
|
| 300 |
+
});
|
| 301 |
+
|
| 302 |
+
document.getElementById('new-scrape-btn').addEventListener('click', function() {
|
| 303 |
+
alert('New scraping job functionality would be implemented here!');
|
| 304 |
+
});
|
| 305 |
+
});
|
| 306 |
+
</script>
|
| 307 |
+
</body>
|
| 308 |
+
</html>
|