Download app.py from carsten12/scraperv2: direct link, hf CLI and curl.
- Browser
- Download file 649 Bytes
-
https://huggingface.co/spaces/carsten12/scraperv2/resolve/main/app.py
- Command line
-
hf download hf://spaces/carsten12/scraperv2/app.py
-
curl -L -o app.py https://huggingface.co/spaces/carsten12/scraperv2/resolve/main/app.py
649 Bytes
| import gradio as gr | |
| import main | |
| import time | |
| def start_scraper(): | |
| logs = "" | |
| try: | |
| for log_line in main.run_scraper(): | |
| logs += log_line + "\n" | |
| yield logs # yield progressively to update textbox | |
| time.sleep(0.1) # small delay to help streaming UI update | |
| except Exception as e: | |
| yield logs + f"\n❌ Error during scraping: {e}" | |
| with gr.Blocks() as demo: | |
| gr.Markdown("# Google Maps Electricians Scraper") | |
| start_btn = gr.Button("Start Scraper") | |
| status_text = gr.Textbox(label="Status / Logs", lines=20) | |
| start_btn.click(fn=start_scraper, outputs=status_text) | |
| demo.launch() | |