Update app.py
Browse files
app.py
CHANGED
@@ -93,10 +93,16 @@ import lxml
|
|
93 |
|
94 |
def define(word):
|
95 |
url = f'https://www.dictionary.com/browse/{word}?s=t'
|
96 |
-
|
97 |
for tag in soup.find_all("meta"):
|
98 |
if tag.get("property", None) == "og:description":
|
99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
#definition= soup.find("meta", property="og:description")
|
101 |
#st.write(definition)
|
102 |
|
|
|
93 |
|
94 |
def define(word):
|
95 |
url = f'https://www.dictionary.com/browse/{word}?s=t'
|
96 |
+
soup = BeautifulSoup(url)
|
97 |
for tag in soup.find_all("meta"):
|
98 |
if tag.get("property", None) == "og:description":
|
99 |
+
content = tag.get("content", None)
|
100 |
+
st.write(content)
|
101 |
+
|
102 |
+
#web_page = soup(requests.get(url, {}).text, "lxml")
|
103 |
+
#for tag in soup.find_all("meta"):
|
104 |
+
#if tag.get("property", None) == "og:description":
|
105 |
+
#st.write(tag.get("content", None))
|
106 |
#definition= soup.find("meta", property="og:description")
|
107 |
#st.write(definition)
|
108 |
|