Spaces:
Build error
Build error
modified output filename
Browse files
app.py
CHANGED
@@ -48,9 +48,10 @@ def scrape(url):
|
|
48 |
)
|
49 |
contents = extract_wikipedia_text(raw_text, language)
|
50 |
json_output = {"source": url, f"title-{language}": title, "pages": contents}
|
51 |
-
|
|
|
52 |
json.dump(json_output, f)
|
53 |
-
return json_output,
|
54 |
|
55 |
|
56 |
style_sheet = "#json-output { max-height: 400px; overflow-y: auto; }"
|
|
|
48 |
)
|
49 |
contents = extract_wikipedia_text(raw_text, language)
|
50 |
json_output = {"source": url, f"title-{language}": title, "pages": contents}
|
51 |
+
filename = f"{url.split('/')[-1]}.json"
|
52 |
+
with open(filename, "w") as f:
|
53 |
json.dump(json_output, f)
|
54 |
+
return json_output, filename
|
55 |
|
56 |
|
57 |
style_sheet = "#json-output { max-height: 400px; overflow-y: auto; }"
|