I'm trying to associate to each species name listed in a csv file the wikipedia summary and main image. I write this code:
import csv
import wikipedia
wikipedia.set_lang('it')
with open('D:\\GIS\\Dati\\Vinca\\specie_vinca.csv', 'rt', encoding="utf8") as f:
reader = csv.reader(f)
for row in reader:
wikipage = wikipedia.page(row)
print (wikipage.title)
print (wikipage.summary)
print ("Page URL: %s" % wikipage.url)
print ("Nr. of images on page: %d" % len(wikipage.images))
print (" - Main Image: %s" % wikipage.images[0])
print ("")
but each time it doesn't encounter a species name the script stops wiht this message "wikipedia.exceptions.PageError". How can I skip these records leaving the script finish?