Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -39,10 +39,10 @@ if st.button("Generate ASCII Screenshot"):
|
|
39 |
try:
|
40 |
screenshot_file = "screenshot.png"
|
41 |
st.write("Capturing website screenshot...")
|
42 |
-
capture_screenshot(url
|
43 |
|
44 |
st.write("Converting to ASCII art...")
|
45 |
-
ascii_output =
|
46 |
|
47 |
# Display ASCII art in a text area
|
48 |
st.text_area("ASCII Art Output", ascii_output, height=600)
|
@@ -52,4 +52,4 @@ if st.button("Generate ASCII Screenshot"):
|
|
52 |
finally:
|
53 |
# Clean up the screenshot file if it exists
|
54 |
if os.path.exists(screenshot_file):
|
55 |
-
os.remove(screenshot_file)
|
|
|
39 |
try:
|
40 |
screenshot_file = "screenshot.png"
|
41 |
st.write("Capturing website screenshot...")
|
42 |
+
capture_screenshot(url.strip('"')) # Strip any extra quotes from the URL
|
43 |
|
44 |
st.write("Converting to ASCII art...")
|
45 |
+
ascii_output = convert_to_ascii(screenshot_file) # Use the correct function
|
46 |
|
47 |
# Display ASCII art in a text area
|
48 |
st.text_area("ASCII Art Output", ascii_output, height=600)
|
|
|
52 |
finally:
|
53 |
# Clean up the screenshot file if it exists
|
54 |
if os.path.exists(screenshot_file):
|
55 |
+
os.remove(screenshot_file)
|