Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,6 +10,8 @@ import io
|
|
10 |
import zipfile
|
11 |
import os
|
12 |
import datetime
|
|
|
|
|
13 |
|
14 |
# Configure logging
|
15 |
logging.basicConfig(level=logging.INFO,
|
@@ -108,7 +110,7 @@ def is_webpage(url):
|
|
108 |
|
109 |
def crawl_url(url, depth, max_depth, visited=None):
|
110 |
"""Recursively crawl a URL up to a specified depth."""
|
111 |
-
|
112 |
visited = set()
|
113 |
|
114 |
if depth > max_depth or url in visited:
|
@@ -251,7 +253,7 @@ def create_interface():
|
|
251 |
"""
|
252 |
)
|
253 |
|
254 |
-
with gr
|
255 |
with gr.Tab("URL Scrape/Screenshot"):
|
256 |
url_input = gr.Textbox(
|
257 |
label="Enter URL(s)",
|
|
|
10 |
import zipfile
|
11 |
import os
|
12 |
import datetime
|
13 |
+
from urllib.parse import urlparse
|
14 |
+
from bs4 import BeautifulSoup
|
15 |
|
16 |
# Configure logging
|
17 |
logging.basicConfig(level=logging.INFO,
|
|
|
110 |
|
111 |
def crawl_url(url, depth, max_depth, visited=None):
|
112 |
"""Recursively crawl a URL up to a specified depth."""
|
113 |
+
if visited is None:
|
114 |
visited = set()
|
115 |
|
116 |
if depth > max_depth or url in visited:
|
|
|
253 |
"""
|
254 |
)
|
255 |
|
256 |
+
with gr.Tabs():
|
257 |
with gr.Tab("URL Scrape/Screenshot"):
|
258 |
url_input = gr.Textbox(
|
259 |
label="Enter URL(s)",
|