Hello Friends,
this project is part of my Personal Assistant 'Lisa'.
In this programme, we are going to get the meanings of words from Dictionary.com
For this purpose, we are using two modules
this project is part of my Personal Assistant 'Lisa'.
In this programme, we are going to get the meanings of words from Dictionary.com
For this purpose, we are using two modules
- urllib
- re
The code is pretty self-explanatory.
import urllib.request
import re
#Take input word from the user
raw = input("search : ")
url = "http://www.dictionary.com/browse/" +raw+ "?s=t"
#using urllib's request function we then get the page
source = urllib.request.urlopen(url).read()
meaning = re.findall(r'name="description" content="(.*?)See more."', str(source))
for arth in meaning:
print(arth.replace("definition", "means"))
0 comments:
Post a Comment