herztard commited on
Commit
cc238ea
·
1 Parent(s): 1e5a29f

Article show

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -31,6 +31,14 @@ categories = ["Politics", "Sports", "Weather", "Culture", "Crime"]
31
 
32
  if st.button("Get tags"):
33
  if news_url.strip():
34
- pass
 
 
 
 
 
 
 
 
35
  else:
36
  st.write("Please enter a valid news URL.")
 
31
 
32
  if st.button("Get tags"):
33
  if news_url.strip():
34
+ article_text = extract_article_text(news_url)
35
+
36
+ if article_text.startswith("Error") or article_text.startswith("Could not"):
37
+ st.write(article_text)
38
+ else:
39
+ st.write("**Extracted Article Text:**")
40
+ st.write(article_text[:500] + "...")
41
+
42
+
43
  else:
44
  st.write("Please enter a valid news URL.")