Update app.py
Browse files
app.py
CHANGED
@@ -91,14 +91,13 @@ from bs4 import BeautifulSoup as bs
|
|
91 |
import lxml.etree as xml
|
92 |
import lxml
|
93 |
|
94 |
-
|
95 |
-
url = f'https://www.dictionary.com/browse/{word}?s=t'
|
96 |
-
web_page = bs(requests.get(url, {}).text, "lxml")
|
97 |
-
meanings = web_page.find_all('div', attrs={'class': 'css-1ghs5zt e1q3nk1v2'})
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
st.write(meanings[0].text)
|
|
|
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 |
+
meanings = web_page.find_all('div', attrs={'class': 'css-1ghs5zt e1q3nk1v2'})
|
98 |
+
for meaning in meanings:
|
99 |
+
st.write('* '+ meaning.text)
|
100 |
+
st.write(meanings[0].text)
|
101 |
+
|
102 |
+
for word in clue_result7:
|
103 |
+
define(word)
|
|