Bonjour,

J'ai cherché un api python me permettant d'extraire les contenus des pages Wikipédia. J'ai trouvé l'api wikipedia avec un code qui sensé travailler puisqu'il se trouve dans la page de présentation de l'api. Voila le code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 
# -*- coding: utf-8 -*-
import wikipedia
print (wikipedia.summary("Wikipedia"))
# Wikipedia (/?w?k??pi?di?/ or /?w?ki?pi?di?/ WIK-i-PEE-dee-?) is a collaboratively edited, multilingual, free Internet encyclopedia supported by the non-profit Wikimedia Foundation...
wikipedia.search("Barack")
# [u'Barak (given name)', u'Barack Obama', u'Barack (brandy)', u'Presidency of Barack Obama', u'Family of Barack Obama', u'First inauguration of Barack Obama', u'Barack Obama presidential campaign, 2008', u'Barack Obama, Sr.', u'Barack Obama citizenship conspiracy theories', u'Presidential transition of Barack Obama']
 
ny = wikipedia.page("New York")
ny.title
# u'New York'
ny.url
# u'http://en.wikipedia.org/wiki/New_York'
ny.content
# u'New York is a state in the Northeastern region of the United States. New York is the 27th-most exten'...
ny.links[0]
# u'1790 United States Census'# Facebook es
wikipedia.set_lang("fr")
wikipedia.summary("Facebook", sentences=1)
et voilà ce que j'ai comme erreur:

C:\My Program Files\Python27\lib\site-packages\requests-2.7.0-py2.7.egg\requests\packages\urllib3\util\ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/l...latformwarning.
InsecurePlatformWarning
C:\My Program Files\Python27\lib\site-packages\requests-2.7.0-py2.7.egg\requests\packages\urllib3\util\ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/l...latformwarning.
InsecurePlatformWarning
C:\My Program Files\Python27\lib\site-packages\requests-2.7.0-py2.7.egg\requests\packages\urllib3\util\ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/l...latformwarning.
InsecurePlatformWarning
Traceback (most recent call last):
File "C:/Users/TRBZ1808/PycharmProjects/taxonomy/test/ExtractWikiContentExample.py", line 3, in <module>
print (wikipedia.summary("Wikipedia"))
File "C:\My Program Files\Python27\lib\encodings\cp1252.py", line 12, in encode
return codecs.charmap_encode(input,errors,encoding_table)
UnicodeEncodeError: 'charmap' codec can't encode character u'\u02cc' in position 12: character maps to <undefined>
J'ai essayé partout de comprendre l'erreur mais toujours sans résultat !

Toute information sera le bien venue et merci d'avance !