Występuje błąd w bieżącej wersji biblioteki python API Wikipedii. Można zainstalować oddział przez lucasdnd on github że stacjonarnej to:
pip install git+https://github.com/lucasdnd/Wikipedia.git
(Można --upgrade
jeśli masz już go zainstalowanego)
Teraz:
>>> import wikipedia
>>> ny = wikipedia.page("New York")
>>> ny.sections
[u'History', u'16th century', u'17th century', u'18th century, the American Revolution, and statehood', u'19th century', u'Immigration', u'September 11, 2001 attacks', u'Hurricane Sandy, 2012', u'Geography', u'Climate', u'Statescape', u'Regions', u'Adjacent geographic entities', u'State parks', u'National parks', u'Administrative divisions', u'Demographics', u'Population', u'Most populous counties', u'Major cities', u'Metropolitan areas', u'Racial and ancestral makeup', u'Languages', u'Religion', u'LGBT', u'Economy', u'Wall Street', u'Silicon Alley', u'Microelectronic hardware and photographic processing', u'Media and entertainment', u'Tourism', u'Exports', u'Education', u'Transportation', u'Government and politics', u'Government', u'Capital punishment', u'Federal representation', u'Politics', u'Sports', u'See also', u'References', u'Further reading', u'External links']
To będzie miejmy nadzieję być fixed in the main library niedługo .
To dziwne, ale wygląda na to 'nigdy sections' działa prawidłowo. Zawsze zwraca pustą listę. – PatNowak
@PatNowak w jaki sposób zweryfikowaliście, zawsze zwraca pustą listę? – mahacoder
Sprawdziłem kilka stron. – PatNowak