J3 commited on
Commit
994b9fe
·
verified ·
1 Parent(s): 12caf28

Make correction to 'get_tomorrows_prediction' tool.

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -37,10 +37,12 @@ def get_tomorrows_prediction(zodiac_sign: str) -> str:
37
  s = soup.find('div', class_='parah_aries_horocope')
38
  content = soup.find_all('p')
39
 
40
- # concatenating a list of strings into a single string and removing tags:
41
- sentence = ' '.join(content[:7]).replace('<p>','').replace('</p>','')
 
 
42
 
43
- return sentence
44
 
45
  except Exception as e:
46
  return f"Error fetching the horoscope."
 
37
  s = soup.find('div', class_='parah_aries_horocope')
38
  content = soup.find_all('p')
39
 
40
+ # Converting tag object to string
41
+ l = []
42
+ for item in content[:6]:
43
+ l.append(item.get_text())
44
 
45
+ return "".join(l)
46
 
47
  except Exception as e:
48
  return f"Error fetching the horoscope."