Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,6 @@ import streamlit as st
|
|
| 2 |
import pandas as pd
|
| 3 |
import requests
|
| 4 |
from bs4 import BeautifulSoup
|
| 5 |
-
from datetime import datetime
|
| 6 |
import os
|
| 7 |
|
| 8 |
def get_metadata(url):
|
|
@@ -50,6 +49,9 @@ if uploaded_file is not None:
|
|
| 50 |
author, published_time, modified_time = get_metadata(url)
|
| 51 |
output_file.write(f"{url},{author},{published_time},{modified_time}\n")
|
| 52 |
|
|
|
|
|
|
|
|
|
|
| 53 |
# Display link to download the output text file
|
| 54 |
st.success("Scraping completed successfully! Click the link below to download the results.")
|
| 55 |
st.markdown(f"[Download Results](sandbox:/home/user/app/output.txt)")
|
|
|
|
| 2 |
import pandas as pd
|
| 3 |
import requests
|
| 4 |
from bs4 import BeautifulSoup
|
|
|
|
| 5 |
import os
|
| 6 |
|
| 7 |
def get_metadata(url):
|
|
|
|
| 49 |
author, published_time, modified_time = get_metadata(url)
|
| 50 |
output_file.write(f"{url},{author},{published_time},{modified_time}\n")
|
| 51 |
|
| 52 |
+
# Display results for each URL
|
| 53 |
+
st.write(f"URL: {url}, Author: {author}, Published Time: {published_time}, Modified Time: {modified_time}")
|
| 54 |
+
|
| 55 |
# Display link to download the output text file
|
| 56 |
st.success("Scraping completed successfully! Click the link below to download the results.")
|
| 57 |
st.markdown(f"[Download Results](sandbox:/home/user/app/output.txt)")
|