awacke1 commited on
Commit
cafc5e6
β€’
1 Parent(s): ca7719a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -95,10 +95,10 @@ def define(word):
95
  url = f'https://www.dictionary.com/browse/{word}?s=t'
96
  web_page = bs(requests.get(url, {}).text, "lxml")
97
  st.write('Definition: ' + web_page)
98
- meanings = web_page.find_all('div', attrs={'class': 'css-1ghs5zt e1q3nk1v2'})
99
  for meaning in meanings:
100
  st.write('* '+ meaning.text)
101
- st.write(meanings[0].text)
102
 
103
  for word in clue_result7:
104
  define(word)
 
95
  url = f'https://www.dictionary.com/browse/{word}?s=t'
96
  web_page = bs(requests.get(url, {}).text, "lxml")
97
  st.write('Definition: ' + web_page)
98
+ meanings = web_page.find_all('meta', attrs={'og:description': 'css-1ghs5zt e1q3nk1v2'})
99
  for meaning in meanings:
100
  st.write('* '+ meaning.text)
101
+ #st.write(meanings[0].text)
102
 
103
  for word in clue_result7:
104
  define(word)