Makima57 commited on
Commit
c2d6566
·
verified ·
1 Parent(s): 084f54d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -1,5 +1,3 @@
1
-
2
- # app.py
3
  import streamlit as st
4
  from googlesearch import search
5
  import requests
@@ -41,8 +39,7 @@ def scrape_text(webpage_content):
41
  # Break multi-headlines into a line each
42
  chunks = (phrase.strip() for line in lines for phrase in line.split(" "))
43
  # Drop blank lines
44
- text = '
45
- '.join(chunk for chunk in chunks if chunk)
46
  return text
47
  except Exception as e:
48
  st.error(f"Failed to scrape text from webpage content: {e}")
@@ -77,5 +74,4 @@ if st.button("Search"):
77
  else:
78
  st.warning("No results found")
79
  else:
80
- st.error("Please enter a query")
81
-
 
 
 
1
  import streamlit as st
2
  from googlesearch import search
3
  import requests
 
39
  # Break multi-headlines into a line each
40
  chunks = (phrase.strip() for line in lines for phrase in line.split(" "))
41
  # Drop blank lines
42
+ text = '\n'.join(chunk for chunk in chunks if chunk)
 
43
  return text
44
  except Exception as e:
45
  st.error(f"Failed to scrape text from webpage content: {e}")
 
74
  else:
75
  st.warning("No results found")
76
  else:
77
+ st.error("Please enter a query")