awacke1 commited on
Commit
289ba75
β€’
1 Parent(s): e78e45b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -10
app.py CHANGED
@@ -97,18 +97,12 @@ def define(word):
97
  url = f'https://www.dictionary.com/browse/{word}?s=t'
98
  r=requests.get(url)
99
  s = soup(r.content, features="lxml")
100
- #soup = BeautifulSoup(url)
101
  for tag in s.find_all("meta"):
102
  if tag.get("property", None) == "og:description":
103
  content = tag.get("content", None)
104
- st.write(content)
105
-
106
- #web_page = soup(requests.get(url, {}).text, "lxml")
107
- #for tag in soup.find_all("meta"):
108
- #if tag.get("property", None) == "og:description":
109
- #st.write(tag.get("content", None))
110
- #definition= soup.find("meta", property="og:description")
111
- #st.write(definition)
112
 
113
  for word in clue_result7:
114
- define(word)
 
 
97
  url = f'https://www.dictionary.com/browse/{word}?s=t'
98
  r=requests.get(url)
99
  s = soup(r.content, features="lxml")
 
100
  for tag in s.find_all("meta"):
101
  if tag.get("property", None) == "og:description":
102
  content = tag.get("content", None)
103
+ return content
104
+
 
 
 
 
 
 
105
 
106
  for word in clue_result7:
107
+ content = define(word)
108
+ st.write(content)