In [4]:
import wikipedia as w
In [24]:
print w.summary("India", sentences=2)
print w.summary("India", chars=200)
In [13]:
try:
print w.summary("India", sentences=2)
except PageError:
print "No wikipedia page found for given word(s)"
In [22]:
#print w.summary("IndiaSomePage", sentences=2)
try:
print w.summary("IndiaSomePage", sentences=2)
except wikipedia.exceptions.PageError as e:
print "No wikipedia page found for given word(s)"