Skip to content

Commit fa36c1c

Browse files
author
codehouseindia
authored
Merge pull request codehouseindia#223 from codebyAbhishekBharti/master
Added a new project to find word meaning
2 parents e4d326c + 8c85471 commit fa36c1c

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

word meaning.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from requests import get
2+
while True:
3+
from bs4 import BeautifulSoup as soup
4+
word = input('\nEnter the word:- ')
5+
try:
6+
res = get(f'https://www.lexico.com/definition/{word}').text
7+
soup = soup(res,'lxml')
8+
data = soup.find("div",class_="trg").p.find('span',class_='ind').text
9+
print(f'WORD:- {word}')
10+
print(f'MEANING:- {data}')
11+
except:
12+
print('Data not available')

0 commit comments

Comments
 (0)