Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
remarks = []
|
2 |
+
for i in range(6):
|
3 |
+
remark = soup.find('span', id=f'Lbl備註{i}')
|
4 |
+
if remark:
|
5 |
+
remarks.append(remark.text.strip())
|
6 |
+
|
7 |
+
# 格式化輸出
|
8 |
+
result = f"{hospital_name}\n查詢院區: {queried_hospital}\n\n各類病床明細表:\n{df.to_string(index=False)}\n\n備註:\n" + "\n".join(remarks)
|
9 |
+
|
10 |
+
return result
|
11 |
+
|
12 |
+
def gradio_interface(url):
|
13 |
+
return get_hospital_data(url)
|
14 |
+
|
15 |
+
iface = gr.Interface(fn=gradio_interface, inputs="text", outputs="text", title="Hospital Bed Data")
|
16 |
+
iface.launch()
|