awacke1 commited on
Commit
7e99736
·
verified ·
1 Parent(s): aaf85bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -38,14 +38,18 @@ def main():
38
  with col1:
39
  st.header("Google Search Results")
40
  if st.button("Search Google"):
41
- google_results = asyncio.run(perform_search(search_query, "Google"))
 
 
42
  for result in google_results:
43
  st.write(f"[{result['title']}]({result['link']})")
44
 
45
  with col2:
46
  st.header("Bing Search Results")
47
  if st.button("Search Bing"):
48
- bing_results = asyncio.run(perform_search(search_query, "Bing"))
 
 
49
  for result in bing_results:
50
  st.write(f"[{result['title']}]({result['link']})")
51
 
 
38
  with col1:
39
  st.header("Google Search Results")
40
  if st.button("Search Google"):
41
+ loop = asyncio.new_event_loop()
42
+ asyncio.set_event_loop(loop)
43
+ google_results = loop.run_until_complete(perform_search(search_query, "Google"))
44
  for result in google_results:
45
  st.write(f"[{result['title']}]({result['link']})")
46
 
47
  with col2:
48
  st.header("Bing Search Results")
49
  if st.button("Search Bing"):
50
+ loop = asyncio.new_event_loop()
51
+ asyncio.set_event_loop(loop)
52
+ bing_results = loop.run_until_complete(perform_search(search_query, "Bing"))
53
  for result in bing_results:
54
  st.write(f"[{result['title']}]({result['link']})")
55