0

Related to, but substantially different from, the problem posed here. I applied the try/except solution posed there in a script for pulling summaries. Code here:

termlist = ['carcass','richard nixon','polar bear']
for term in termlist:
    try:
        p =wikipedia.summary(wse(term)[0])
    except wikipedia.DisambiguationError as e:
        p = wikipedia.summary(e.options)[0]
    print(p)

The problem is that the except branch returns another disambiguation error. What can I do here outside of nesting/ recursion?

0 Answers0