awacke1 commited on
Commit
b43c9d6
β€’
1 Parent(s): 8c1bc7e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
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
- web_page = soup(requests.get(url, {}).text, "lxml")
97
  for tag in soup.find_all("meta"):
98
  if tag.get("property", None) == "og:description":
99
- st.write(tag.get("content", None))
 
 
 
 
 
 
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