Makima57 commited on
Commit
eea466c
·
verified ·
1 Parent(s): 0521a44

Update app.py

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