Spaces:
Runtime error
Runtime error
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Smart Web Scraper</title> | |
| <style> | |
| @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap'); | |
| * { margin: 0; padding: 0; box-sizing: border-box; } | |
| body { | |
| font-family: 'Poppins', sans-serif; | |
| background: linear-gradient(135deg, #283c86, #45a247); | |
| height: 100vh; | |
| display: flex; | |
| flex-direction: column; | |
| justify-content: center; | |
| align-items: center; | |
| color: #fff; | |
| } | |
| .card { | |
| background: rgba(255, 255, 255, 0.15); | |
| padding: 40px 50px; | |
| border-radius: 20px; | |
| backdrop-filter: blur(12px); | |
| box-shadow: 0 8px 25px rgba(0,0,0,0.3); | |
| text-align: center; | |
| animation: fadeIn 1.2s ease-in-out; | |
| } | |
| h1 { | |
| font-size: 42px; | |
| margin-bottom: 10px; | |
| letter-spacing: 1px; | |
| } | |
| p { | |
| font-size: 18px; | |
| margin-bottom: 25px; | |
| color: #f2f2f2; | |
| } | |
| input[type="text"] { | |
| width: 380px; | |
| padding: 12px; | |
| border-radius: 8px; | |
| border: none; | |
| outline: none; | |
| font-size: 16px; | |
| margin-bottom: 20px; | |
| } | |
| .tag-buttons { | |
| margin: 10px 0 25px 0; | |
| } | |
| .tag-buttons button { | |
| background: rgba(255,255,255,0.2); | |
| border: 1px solid #fff; | |
| color: #fff; | |
| border-radius: 8px; | |
| margin: 5px; | |
| padding: 8px 16px; | |
| cursor: pointer; | |
| font-size: 15px; | |
| transition: all 0.3s; | |
| } | |
| .tag-buttons button:hover, | |
| .tag-buttons button.active { | |
| background-color: #00c9a7; | |
| transform: scale(1.05); | |
| color: #222; | |
| } | |
| input[type="submit"] { | |
| padding: 12px 30px; | |
| background: linear-gradient(90deg, #00c9ff, #92fe9d); | |
| border: none; | |
| border-radius: 30px; | |
| color: #222; | |
| font-size: 17px; | |
| cursor: pointer; | |
| transition: all 0.3s; | |
| } | |
| input[type="submit"]:hover { | |
| transform: scale(1.07); | |
| background: linear-gradient(90deg, #92fe9d, #00c9ff); | |
| } | |
| footer { | |
| position: absolute; | |
| bottom: 15px; | |
| color: #e0e0e0; | |
| font-size: 14px; | |
| } | |
| @keyframes fadeIn { | |
| from {opacity: 0; transform: translateY(40px);} | |
| to {opacity: 1; transform: translateY(0);} | |
| } | |
| </style> | |
| <script> | |
| function setTag(tagName) { | |
| document.getElementById('selectedTag').value = tagName; | |
| const buttons = document.querySelectorAll('.tag-buttons button'); | |
| buttons.forEach(btn => btn.classList.remove('active')); | |
| event.target.classList.add('active'); | |
| } | |
| </script> | |
| </head> | |
| <body> | |
| <div class="card"> | |
| <h1>π Smart Web Scraper</h1> | |
| <p>Enter a website and select which tag you want to scrape (H1, H2, etc.)</p> | |
| <form method="POST" action="/"> | |
| <input type="text" name="url" placeholder="https://indianexpress.com/" required><br> | |
| <div class="tag-buttons"> | |
| <button type="button" onclick="setTag('h1')">H1</button> | |
| <button type="button" onclick="setTag('h2')" class="active">H2</button> | |
| <button type="button" onclick="setTag('h3')">H3</button> | |
| <button type="button" onclick="setTag('p')">P</button> | |
| <button type="button" onclick="setTag('span')">SPAN</button> | |
| </div> | |
| <input type="hidden" name="tag" id="selectedTag" value="h2"> | |
| <input type="submit" value="Scrape Now π"> | |
| </form> | |
| </div> | |
| <footer>Made with β€οΈ using Flask & BeautifulSoup</footer> | |
| </body> | |
| </html> | |