rairo commited on
Commit
65acf1d
·
verified ·
1 Parent(s): 03b308c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -101,8 +101,12 @@ def get_data_from_url(url):
101
  except TypeError as te:
102
  # Fallback if an unexpected keyword argument 'type' is raised
103
  if "unexpected keyword argument 'type'" in str(te):
104
- st.warning("Falling back to alternative scraping method due to unexpected keyword argument 'type'.")
105
- web_content = supadata.scrape(url)
 
 
 
 
106
  else:
107
  raise te
108
 
@@ -149,6 +153,7 @@ def get_data_from_url(url):
149
 
150
 
151
 
 
152
  def process_multiple_search_terms(search_terms):
153
  """
154
  Process multiple search terms with progress tracking.
 
101
  except TypeError as te:
102
  # Fallback if an unexpected keyword argument 'type' is raised
103
  if "unexpected keyword argument 'type'" in str(te):
104
+ st.warning("Falling back due to unexpected keyword argument 'type'.")
105
+ if hasattr(supadata, "scrape"):
106
+ web_content = supadata.scrape(url)
107
+ else:
108
+ st.error("Fallback method not available: supadata does not have 'scrape'.")
109
+ return {}
110
  else:
111
  raise te
112
 
 
153
 
154
 
155
 
156
+
157
  def process_multiple_search_terms(search_terms):
158
  """
159
  Process multiple search terms with progress tracking.