Update app.py
Browse files
app.py
CHANGED
|
@@ -87,18 +87,15 @@ st.write(clue_result7)
|
|
| 87 |
|
| 88 |
|
| 89 |
import requests
|
| 90 |
-
from bs4 import BeautifulSoup as
|
| 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 |
-
|
| 98 |
-
|
| 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)
|