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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -87,18 +87,15 @@ st.write(clue_result7)
87
 
88
 
89
  import requests
90
- from bs4 import BeautifulSoup as bs
91
  import lxml.etree as xml
92
  import lxml
93
 
94
  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('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)
 
87
 
88
 
89
  import requests
90
+ from bs4 import BeautifulSoup as soup
91
  import lxml.etree as xml
92
  import lxml
93
 
94
  def define(word):
95
  url = f'https://www.dictionary.com/browse/{word}?s=t'
96
  web_page = bs(requests.get(url, {}).text, "lxml")
97
+ definition= soup.find("meta", property="og:description")
98
+ st.write(definition)
 
 
 
99
 
100
  for word in clue_result7:
101
  define(word)