Commit c18048e0 authored by Marc Abonce Seguin's avatar Marc Abonce Seguin

exclude disambiguation pages from wikipedia infobox

parent 34ad3d6b
......@@ -21,7 +21,8 @@ search_url = base_url + u'w/api.php?'\
'action=query'\
'&format=json'\
'&{query}'\
'&prop=extracts|pageimages'\
'&prop=extracts|pageimages|pageprops'\
'&ppprop=disambiguation'\
'&exintro'\
'&explaintext'\
'&pithumbsize=300'\
......@@ -87,7 +88,7 @@ def response(resp):
if int(article_id) > 0:
break
if int(article_id) < 0:
if int(article_id) < 0 or 'disambiguation' in page.get('pageprops', {}):
return []
title = page.get('title')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment