Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -231,4 +231,23 @@ def download_and_zip_pdfs_selenium(url, progress=gr.Progress()):
|
|
| 231 |
shutil.rmtree(temp_dir)
|
| 232 |
return None, f"❌ Unexpected error: {str(e)}"
|
| 233 |
|
| 234 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
shutil.rmtree(temp_dir)
|
| 232 |
return None, f"❌ Unexpected error: {str(e)}"
|
| 233 |
|
| 234 |
+
with gr.Blocks(title="PDF Downloader & Zipper", theme=gr.themes.Soft()) as demo:
|
| 235 |
+
gr.Markdown("""
|
| 236 |
+
# 📥 PDF Downloader & Zipper (Selenium)
|
| 237 |
+
|
| 238 |
+
Downloads all PDFs from a webpage using Selenium WebDriver.
|
| 239 |
+
""")
|
| 240 |
+
|
| 241 |
+
url_input = gr.Textbox(label="Enter Webpage URL", placeholder="https://example.com/pdfs/")
|
| 242 |
+
submit_btn = gr.Button("📥 Download & Zip PDFs", variant="primary")
|
| 243 |
+
status_output = gr.Markdown()
|
| 244 |
+
download_output = gr.File(label="Download Zip File")
|
| 245 |
+
|
| 246 |
+
submit_btn.click(
|
| 247 |
+
fn=download_and_zip_pdfs_selenium,
|
| 248 |
+
inputs=[url_input],
|
| 249 |
+
outputs=[download_output, status_output]
|
| 250 |
+
)
|
| 251 |
+
|
| 252 |
+
if __name__ == "__main__":
|
| 253 |
+
demo.launch()
|