awacke1 commited on
Commit
6decdc5
β€’
1 Parent(s): 19457ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -90,17 +90,13 @@ import requests
90
  from bs4 import BeautifulSoup as soup
91
  import lxml
92
  import lxml.etree as xml
93
-
94
- def main():
95
- r = requests.get('http://www.sourcebits.com/')
96
- soup = BeautifulSoup(r.content, features="lxml")
97
 
98
  def define(word):
99
  url = f'https://www.dictionary.com/browse/{word}?s=t'
100
  r=requests.get(url)
101
- soup = BeautifulSoup(r.content, features="lxml")
102
  #soup = BeautifulSoup(url)
103
- for tag in soup.find_all("meta"):
104
  if tag.get("property", None) == "og:description":
105
  content = tag.get("content", None)
106
  st.write(content)
 
90
  from bs4 import BeautifulSoup as soup
91
  import lxml
92
  import lxml.etree as xml
 
 
 
 
93
 
94
  def define(word):
95
  url = f'https://www.dictionary.com/browse/{word}?s=t'
96
  r=requests.get(url)
97
+ s = soup(r.content, features="lxml")
98
  #soup = BeautifulSoup(url)
99
+ for tag in s.find_all("meta"):
100
  if tag.get("property", None) == "og:description":
101
  content = tag.get("content", None)
102
  st.write(content)